(Batch) Printing Reports With (free) ScriptX

In this sample, a set of reports are printed. Each report is generated at the server (an ASP page) and delivered back to the browser within a hidden iFrame. The ScriptX object is included in this parent document and has been initialised with all the parameters required for printing; headers, footers etc. When the frame is ready for printing, it performs the print.

How do we know the frame is ready for printing? There are two possibilities; the document loaded into the iframe includes script for the onload event and the script calls a function in the parent document or use the onDocumentComplete method of ScriptX. Both of these methods suffer from the same problem - there is no way of knowing that the document load has failed for some reason.

This sample represents a slightly more complex solution than the solution that utilises showModalDialog because global state must be remembered while the asynchronous document loads take place. However, an advantage is that because of this asynchronicity, the batch printing process can be cancelled.

This sample does not work very well over the Internet because the print dialog will be displayed for each report - this will not occur within an intranet.


Customise the report....

Your name: 

Select the reports to be printed:

Please wait for printing to complete.