Solved

printing in php!!!!!

Posted on 2002-06-20
11
212 Views
Last Modified: 2006-11-17
hai all,

I have a php(+html codes) thru which I try to display my queries.
In that if I add print button(which links to javascript window.print function),Iam able to print the table with no format.If I wanted to print only 30 rows in one page & remaining in successive pages(/page= 30 rows),how am I implement this feature.can anyone help resolve this issue.

Thanking you,
manju
0
Comment
Question by:manju70
11 Comments
 
LVL 4

Expert Comment

by:lokeshv
ID: 7097809
Display 30 rows per page..and print it :o)

Lk
0
 

Author Comment

by:manju70
ID: 7098250
yes
0
 
LVL 8

Accepted Solution

by:
us111 earned 18 total points
ID: 7098317
- create a button
- add a javascript action that calls and opens a new php page
- this page display 30 rows
- open the print windows

I have no other solutions
0
 
LVL 17

Expert Comment

by:psimation
ID: 7098593
manju70
us111 is correct, maybe to help to make it more clear, use your existing code , and then simply limit your output to 30 lines . This can be done by adding a "...limit 30" to the end of your SQL query, or to have a while loop that only creates 30 lines at a time, and then have a "next" link on the page to execute and display the rest of the lines , 30 ata a time.
 
0
 
LVL 8

Expert Comment

by:us111
ID: 7098598
but if your page has more than 30 records, it would be impossible to print 2 friendly pages
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Expert Comment

by:Hamlet081299
ID: 7105856
I think there is actually an HTML code which will force a page break in printing (I forget what it is though), but there may be better ways of doing this.

You could try rendering the output as a PDF, and then printing.

You could also have the print button link to another page, which automatically loads 30 records at a time and prints each one, then automatically jumps to the next 30, etc.
0
 
LVL 40

Expert Comment

by:RQuadling
ID: 7106815
There are CSS Style print codes. These are NOT HTML codes.

The full definition is at ...

http://www.w3.org/TR/1998/REC-CSS2-19980512/page.html

but your broweser (or rather your customer's browser) will need to support this!!!

Without doubt, the best way is to send the client a pre-rendered document (rtf/pdf/DOC via COM!!!/etc).

Having a seperate window with the table size being set by the end-user is a good idea. Simpler to implement than PDF (maybe), but no automation as the print command returns true immediately, even if the printing is still working. So you can't generate 10 pages, calling the print event between each generation as you will probably get 9 headers and then 1 full page. It'll be a mess!

Richard.
0
 

Author Comment

by:manju70
ID: 7109751
hai all,

Thank you for your responses.
I got my requirements as per us111 & psimation comments.
So I wanted to distribute my points among these 2 experts.I have asked the commnunity support to distribute it accordingly.

a big thanks for all who contributed.
Manju

0
 
LVL 8

Expert Comment

by:us111
ID: 7109915
thx
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7114290
Per request (http://www.experts-exchange.com/commspt/Q_20316277.html), points reduced to 18 to facilitate split.

manju70,

You should now leave a 17-point question in this topic area for one of the two Experts. Then come back to this question and accept the comment of the other, and leave a link here to the "points for" question.

In the "points for" question, be sure to leave a link back to this question to complete the circle.

Netminder
CS Moderator
0
 

Author Comment

by:manju70
ID: 7115459
hai psimation,

As I wanted to distribute my marks between u & us111 , I have created another question(as per community support instructions)
the link is
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=php&qid=20317170

after u answer, the points will evventually deposited in ur account.

Thank u,
manju
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now