I have to print two reports and would like to set the printer only one time.
That means the user choose the printer for the first report and the same printer will be used for the second report without another print dialog.
How can I get the PrinterName from the print dialog ?
PrinterName in PrinterSettings
-
- Posts: 43
- Joined: Fri May 25, 2007 2:54 am
- Location: Austria
PrinterName in PrinterSettings
Code: Select all
using(PrintDialog selectPrinter = new PrintDialog())
{
System.Drawing.Printing.PrinterSettings printerSettings = new System.Drawing.Printing.PrinterSettings();
selectPrinter.PrinterSettings = printerSettings;
if(selectPrinter.ShowDialog() == DialogResult.OK)
{
//Load Report 1
StiReport report1 = new StiReport();
report1.Load("MyFirstReport.mrt");
//Load Report 2
StiReport report2 = new StiReport();
report2.Load("MySecondReport.mrt");
//Render Reports but Hide Progress Form
report1.Render(false);
report2.Render(false);
//Print Reports using our Selected Printer / Settings
report1.Print(false, printerSettings);
report2.Print(false, printerSettings);
}
}
-
- Posts: 43
- Joined: Fri May 25, 2007 2:54 am
- Location: Austria
PrinterName in PrinterSettings
Thanks for your answer.
Meanwhile I´ve solved the problem like you suggested.
Best regards !
Meanwhile I´ve solved the problem like you suggested.
Best regards !