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
Problem with PrintToDotMatrixPrinter-Method
Problem with PrintToDotMatrixPrinter-Method
Hello.
Please try to use the following code, for example:
Thank you.
Please try to use the following code, for example:
Code: Select all
stiReport.PrinterSettings.ShowDialog = false;
stiReport.PrintToDotMatrixPrinter(printerSettings.PrinterName);
Problem with PrintToDotMatrixPrinter-Method
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
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
Problem with PrintToDotMatrixPrinter-Method
Hello,
We are always glad to help you.
Let us know if you need any additional help.
Thank you.
In this case please modify your code:If we do it this way, the Printersettings are being ignored.
Code: Select all
stiReport.PrinterSettings.ShowDialog = false;
if (stiReport.CompiledReport != null) stiReport.CompiledReport.PrinterSettings.ShowDialog = false;
stiReport.PrintToDotMatrixPrinter(printerSettings.PrinterName);
Let us know if you need any additional help.
Thank you.