Page 1 of 1

Set PrinterSettings before Print Preview (report.Show(true))

Posted: Fri Dec 14, 2012 8:13 am
by OlafD
Hi there,

is there any way to set the PrinterSettings before print to Preview wth report.Show(true)) like the report.Print(printerSettings)?

Thanks

Olaf

Re: Set PrinterSettings before Print Preview (report.Show(tr

Posted: Fri Dec 14, 2012 8:31 am
by HighAley
Hello.

Some printer settings could be changed in the report.PrinterSettings property.

Thank you.

Re: Set PrinterSettings before Print Preview (report.Show(tr

Posted: Fri Dec 14, 2012 9:32 am
by OlafD
Hello,

i know this, but you can change only the Copies an the Printer Name.
Wahts about the PaperSource etc. etc.

Whats about :
PrinterSettings printerSettings = new ....
report.Show(true, printerSettings ))

Re: Set PrinterSettings before Print Preview (report.Show(tr

Posted: Fri Dec 14, 2012 10:20 am
by HighAley
Hello.

You could handle the Stimulsoft.Report.StiOptions.Engine.GlobalEvents.ReportPrinting event to change report settings.

Thank you.

Re: Set PrinterSettings before Print Preview (report.Show(tr

Posted: Fri Dec 14, 2012 11:17 am
by OlafD
Do you have a sample source code to set the PrinterSettimg by a PrinterSettings Object or the PaperSource

Re: Set PrinterSettings before Print Preview (report.Show(tr

Posted: Fri Dec 14, 2012 1:30 pm
by HighAley
Hello.

We need some time to prepare an answer for you.

Thank you.

Re: Set PrinterSettings before Print Preview (report.Show(tr

Posted: Mon Dec 17, 2012 7:36 am
by HighAley
Hello.

Please, read an article in our Knowledge Base
Thank you.

Re: Set PrinterSettings before Print Preview (report.Show(tr

Posted: Mon Dec 17, 2012 8:04 am
by OlafD
i ask for a sample to set the PrinterSetting by a PrinterSettings Object, not for "How to enable the editor-mode from code".
Thank you.

Re: Set PrinterSettings before Print Preview (report.Show(tr

Posted: Mon Dec 17, 2012 1:53 pm
by HighAley
Hello.

Sorry, it was our mistake. You should use the PrintingDocumentInViewer global event.

The code to handle it:

Code: Select all

StiOptions.Engine.GlobalEvents.PrintingDocumentInViewer += new EventHandler(GlobalEvents_PrintingDocumentInViewer);
report.Show(true);
...............

void GlobalEvents_PrintingDocumentInViewer(object sender, EventArgs e)
{
    PrinterSettings ps = new PrinterSettings();
    ps.Copies = 2;
    ps.PrinterName = "Fax";
    ((StiReport)sender).Print(ps);
}
Thank you.