Generate a report for screen view and for print view using css

1.4k Views Asked by At

I have a webpage with a report that is paginated while displaying on the screen. This is done using displaytag. Only the number of records to be displayed on screen are queried. While printing, however, it should print the complete report.

I wrote a javascript that is called on click of the print button. My idea was to regenerate the report without pagination parameters and then print it. Can this be done without displaying the complete content on the screen?

Are there any other ways to do this?

Thank you for your help.

1

There are 1 best solutions below

1
On BEST ANSWER

than one otpion is create new style sheet where media=print

which look as like

<link rel="stylesheet" type="text/css" media="print" href="print.css">

you can read more : CSS Media types and printer friendly pages