C# printing rdlc report unattended

546 views Asked by At

I am working on a C# WinForm application that currently has several RDLC reports in it, and those reports need to print at a given time without any user interaction.

The good news, is I found code to do that at Printing A Local Report Without Preview

Unfortunately, while that works fairly well, when it prints, it puts up a small window saying "Printing page x of y" - is there any way to hide/suppress that window, so it can print silently while the user continues to work within the application?

2

There are 2 answers

0
Scott On

Never mind - I found the solution on my own:

Turns out all you need to do is add the following line before doing the printDoc.Print in the code:

printDoc.PrintController = new StandardPrintController();

0
tezzo On

Because you are using PrintDocument you can use this solution:

How to skip the dialog of printing in printDocument.print() and print page directly?