views:

58

answers:

1

No thoughts on this one? Anyone?


Here is my scenario:

I have a form where the user selects a report type, and then selects a list of users they want to generate reports for. When they submit the form, a new window is opened that uses pagination to allow the user to review each user report individual by using next and previous links.

The user wants the option to:

  1. print both the currently displayed report by itself (that's an easy one), and
  2. a "print all" option to print all the selected reports.

However, each report for each user must have its own "Page x of n" footer.

For the footer, I have been using the browser footer options, but in order to have the page numbering start new on each report printout, I have to make a separate window.print() call for each one. I have implemented this this way, and it works, but it's awful because each print() call causes a new print dialog to display, meaning the user has to click print in each dialog to finalise the print request. Many reports = a stupid number of popped up print dialogs.

Ideally, I would like the printing of a report group to look like a single print job, but I need that page count to be restarted for each report.

I thought of trying to count pages myself to make my own footer, but that seemed like a daunting task considering all the variables that could affect how many pages a report would occupy. I also read some about using ActiveX and WebBrowser objects to force prints and hide the print dialog, but I have had no success with that because I am running on XP SP2. Also, I understand it's frowned upon from a security perspective, and it's not a good cross-browser solution.

Has anyone dealt with printing of this type before and would have some suggestions for a way to make this work or a better way to handle it?

Thanks in advance.

A: 

I've seen this done two ways the simplist using the MeadCo scriptx component which alows you to print without a dialog. But as you rightly say this is not good from a security perspective. This was done in a corporate environment where they had control over the end users browser.

The second would be to go down the ajax route and load each report page individually, without prining, then concat each report html together into one doucment adding any needed page breaks. Finally rendering to an IFRAME and calling print on that frame to print all reports in one action.

Lee Hesselden
Thanks for the response, I was beginning to wonder if anyone was out there :) I will check out the MeadCo scriptx because I am doing this development on an Intranet, so I have control. About your second option, wouldn't concating the reports together mean that I would lose individual page numbering for each report? I originally had them all printed in the same browser window, but then I could see how to restart the page numbering. Thanks again.
Carvell Fenton
Sorry, last line should be "... but then I COULDN'T see how to restart the page numbering."
Carvell Fenton
Yes, you'd have to go down the route of a manual implementation for the page numbers.
Lee Hesselden
Yeah, I was afraid you were going to say that...
Carvell Fenton