PrintDialog and 4 PrintDocuments

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,530
Location
Lansing, MI; USA
Programming Experience
10+
I have 4 print document controls all set up and working, each one uses a PrintDialog to know which printer to print to which works fine.

Now I need to ability to print multiple combinations of the 4 PrintDocument's only using a PrintDialog once.

How can I do this?

I was thinking of opening the PrintDialog and if the user does not click cancel then storing all of the info of the dialog to variables and applying those variables to the PrintDocuments manually before each one gets printed

basically show a PrintDialog without a document specified and holding the values separately and applying them on my own

any idea's?
 
How about this: (only tested with .Net 2.0 so far :eek:)
VB.NET:
If PrintDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
    PrintDocument1.DefaultPageSettings.PrinterSettings = PrintDialog1.PrinterSettings
    PrintDocument2.DefaultPageSettings.PrinterSettings = PrintDialog1.PrinterSettings
    PrintDocument1.Print()
    PrintDocument2.Print()
End If
No PrintDocument was assigned the PrintDialog.
 
that's what i was thinking, i havent looked into any of this since last thursday

the other option i was thinking was to have 1 print document and have a sub for each of the 4 sections instead of each section having it's own printdocument too

the logic would be very complex but it could work
 
Preview is obviously a problem if the printout comes from several PrintDocuments in "code behind" and so would selecting page ranges, adding some logic to add sections to one single PD would solve both these.
 
right now I'm testing the option of having 1 PrintDialog and 4 PrintDocument's, PrintPreview is not something that will be allowed in this app, neither is the selecting of PageRanges. The printing will be done automatically based on the selected printer, the printer is selected when the app is first ran and is stored in a configuration file so when the user clicks print (after it's been configured) the printer simply fires up and spits out all the data (the user never sees a select printer dialog either, admins can change this setting in the configuration form)
 
Back
Top