View Full Version : how do I make a webpage reopen itself on close?

01-24-2005, 10:15 PM
A bit of background: I am creating a trusted internal application for a company ( you cannot browse to this site from the internet ) that uses IE6.02 for the user interface.

At one point, I am using a PERL script for printing a schedule for a number of staff. I have a PERL script developed that works great when passed a single staff_id. It opens itself, prints the page, and closes the page ( using an ActiveX control that is trusted by the users ).

Now I would like to pass this script a comma delimited list of staff IDs and have it print the 1st ID then recycle itself with the remaining ID's until all the ID's have printed.

At the moment I have a simple "self.close()" statement run at the end of the single ID version of the page that closes the window and returns control to the calling page.

My question is this, is there someway I can replace the self.close() with a statement that calls :


so that the page calls itself when it closes until all the staff IDs have been printed?

at the moment, for the multi-ID version of the page I have:

function recyclepage()
if ( areThereMoreIDs == 'Y' )
} else {

In this case, "areThereMoreIDs" is set based on the comma delimited stafflist variable. Each iteration, the PERL script strips the first ID from the string and sets the form variable "stafflist" to the remaining ( unprocessed ) IDs

Any help would be appreciated.

01-25-2005, 03:21 AM
Why not modify the perl script to accommodate multiple ids at the same time? Is that possible?

01-25-2005, 07:28 PM
I want to print one staff members schedule on a single page ... the PERL script opens a browser window, displays header info about the staff member, the schedule info, and some footer info, and this requires 1 page-length of space. Once the page is displayed, a Java-script call to an ActiveX component sends the to the printer, then another java-script command closes the page.

The PERL script can easily process each staff member in turn, but that requires a single generated web-page to format and print more than 1 page to the printer. Perhaps a good question would be how do you make a single webpage print across multiple print-pages?

Just seemed easier to recycle the page with no special printer control code.

So, is there someway in java you can send a page-break to the standard windows printer and print 2 or 3 pages ( with correctly formatted header,body,footer formatting ) from a single webpage?

Willy Duitt
01-25-2005, 07:41 PM
Have you tried outputting everything to one page and seperating the various staff by using:

<DIV style="page-break-after:always">staff one content</DIV>
<DIV style="page-break-after:always">staff two content</DIV>

And merely calling your print function once and closing when done....


01-29-2005, 07:57 PM
Works great!