Problem with PrintToDotMatrixPrinter-Method

Stimulsoft Reports.NET discussion
Post Reply
joro
Posts: 63
Joined: Wed Jan 27, 2010 7:35 am

Problem with PrintToDotMatrixPrinter-Method

Post by joro »

Hello!

I want to print a report to a DotMatrix-printer without being prompted to choose a printer.
When i usually print a report i do it like: stiReport.Print(false, printerSettings); - disable to ShowPrintDialog option.

Using the DotMatrix-Printer i call: stiReport.PrintToDotMatrixPrinter(printerSettings.PrinterName);
But the PrintDialog appears all of the time. I am being asked to chose a printer even though i've already called to method with the appropriate printername.

I hope you can help me on this.

best regards
joro
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Problem with PrintToDotMatrixPrinter-Method

Post by Ivan »

Hello.

Please try to use the following code, for example:

Code: Select all

stiReport.PrinterSettings.ShowDialog = false;
stiReport.PrintToDotMatrixPrinter(printerSettings.PrinterName);
Thank you.
joro
Posts: 63
Joined: Wed Jan 27, 2010 7:35 am

Problem with PrintToDotMatrixPrinter-Method

Post by joro »

Hi Ivan!

Thanks for your answer. I already tried that code before but it didn't work.
Then I found out that somewhere in our code we are compiling/rendering our report and after this, we set stiReport.PrinterSettings.ShowDialog to false.
Like:
stiReport.Compile();
.
.
.
stiReport.PrinterSettings.ShowDialog = false;
stiReport.PrintToDotMatrixPrinter(printerSettings.PrinterName);

If we do it this way, the Printersettings are being ignored.
Now we are setting the printersettings before we compile and everything is fine.

Thanks for your help

joro
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

Problem with PrintToDotMatrixPrinter-Method

Post by Ivan »

Hello,
If we do it this way, the Printersettings are being ignored.
In this case please modify your code:

Code: Select all

stiReport.PrinterSettings.ShowDialog = false;
if (stiReport.CompiledReport != null) stiReport.CompiledReport.PrinterSettings.ShowDialog = false;
stiReport.PrintToDotMatrixPrinter(printerSettings.PrinterName);
We are always glad to help you.
Let us know if you need any additional help.

Thank you.
Post Reply