Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

printing in php!!!!!

Posted on 2002-06-20
11
Medium Priority
?
223 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 54 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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
 
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:Richard Quadling
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

824 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