Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

print multiple reports by copying div container content data.



1:12 am on Jul 15, 2012 (gmt 0)

5+ Year Member

Hi all,

I'm trying to figure out the proper way to construct and print multiple work order reports - all at once.

I currently have a div container that has css styled and formatted html tags that print out a single work order report sheet using the jquery "printElement" plugin. When i press the work order entry form print button, my print-work-order(WOID) javascript function populates and prints a hidden div container that contains a formatted work order sheet layout.

I'd like to also be able to print multiple work order reports by...
    1. populating the hidden div container with the next work order data
    2. appending or adding the div container and contents to some variable or structure
    3. keep populating and appending the div container to the variable or structure until all selected work orders are processed
    4. use either the same printElement plugin or some other method to print all the stacked work order divs (sheets) at once - one work order per sheet.
I've never tried to do this before so i'm at a loss as to how to proceed. I'm guessing i can use jquery methods to accomplish this - i just don't know how. In fact, i'm starting to thinking that constructing the work order report directly into a javascript variable or structure may be a better idea than using a hidden div container - i'm just not sure.

I'm thinking i have the right idea or approach, but i would appreciate some further insite on this issue.



5:29 am on Jul 15, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Hi nelsonm

Once you start getting into multi-page printing you start getting into such things as working out where the page break should be etc. it can get messy fast.

It sounds like you are trying to change a process that works fine for a single work order, but would be a bad fit for multiple work orders.

I would actually rather use a design where the work orders are marked as ready for printing in the back-end and when the user is ready they click on print all pending work orders and you call another page which then gets all those work orders and formats them or even have a back-end report generator that formats them.


2:09 pm on Jul 15, 2012 (gmt 0)

5+ Year Member

Hi Dijkgraaf,

Other than the single print button already on the work order add/edit entry form that when clicked pops up the browsers print dialog, the user has two screens where they could (once its programmed) mark or check each work order they'd like to print. One is the calendar dispatch board page and the other is the work order list grid page.

In any case, it sounds like what your saying is that instead of stacking each work order into one structure or variable or hidden div with page breaks in between each, you think it would be simpler to as you say "have a back-end report generator" function that formats and prints each selected work order directly to the printer one at a time automatically eliminating the need to manage page breaks.

For now, lets stay with my use of the static hidden div container to generate the printable work order. So how do you get javascript/jquery in the "report generator" function to send each work order to the default printer directly without having the browser's print dialog popup? I'm currently using firefox as the browser.



8:36 pm on Jul 15, 2012 (gmt 0)

5+ Year Member


From what i've been reading, it looks like there is no way to print directly to the default printer without the printer popup dialog in any browser.

This would imply that appending multiple formatted report div containers with page breaks inserted in between each into a variable or structure that could be used by something like the printElement plugin would be the only option.

Featured Threads

Hot Threads This Week

Hot Threads This Month