Link to home
Start Free TrialLog in
Avatar of AnneF

asked on

javascript:window.print() does not print following pages

I have designed a page, displayed in its own window, to print using the javascript:window.print()
This page contain many gridviews, and should be printed between 3 and 10 pages depending on the info entered. However it only prints the first page. (Test have been done using IE7).
Any reason why, and solution?
Thanks for your help
Avatar of scrathcyboy
Flag of United States of America image

Javascript window print function only loads the default windows print dialog, where you can choose the number of pages in sequence.  If the "page contain many gridviews, and should be printed between 3 and 10 pages depending on the info entered" , this basic javascript print dialog using the windows default printer dialog is not going to work for you.

You would have to have a dialog where the parameters are chosen up front, and then that is submitted to a PHP page or ASP script that can specifically print the individual page setups required.  Else just tell the user how to print the pages they need.  Javascript printing is VERY basic -- little interactivity.
Avatar of Hagay Mandel
Use parent.print() instead of window.print().
Avatar of AnneF


Hi HagayMandel, I tried Parent.print, but it did the same, display the full page, but when you print it only print the first page.
Scrathcyboy, How and where do I start, could you give me some help or indication.
Thanks for your help, and Merry Christmas.
"This page contain many gridviews, and should be printed between 3 and 10 pages depending on the info entered."

That is all the info you have given us, not enough to tell you where to start.  Create an ASP or javascript dialog where, as they set up each page, each page is printed separately if the config. is so different.
Avatar of AnneF


The application has been developed for business who want to apply for a grant. They have to answers a list of questions (about 30), fill a budget table, a saving table, and few other tables, ie Detail of people working on the project, Milestones...
I have attached the report (copy and paste) in word, so you can have a look at it.
The report, has a first gridview, that displays the 30 questions, hence the between 3 and 10 pages printed depending on the info entered. Then all the other gridviews (in the 3 appendix section), Budget, savings, Milestone... All together I have 16 gridviews with questions and often headers been database driven so the application is adaptable for many different programs without changing much.
I'd like to use an asp page to print the report, as it took me only 2 hours to develop it, as the gridviews already exist in different part of the application, all I have to do is copy and paste and alter a bit the code behind. These application form has to be updated in a very tight timeframe, so modification as to optimized.
Ideally I would like to print it in a pdf format, but I haven't found anything that would do it.

Avatar of Hagay Mandel
Hagay Mandel
Flag of Israel image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AnneF


Fantastic. It was the overflow in the css.
Thank you