Solved

printing in php!!!!!

Posted on 2002-06-20
11
213 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

770 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