Click here to Skip to main content
14,697,231 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to print report viewer without print dialog any help her
Posted
Comments
[no name] 10-Jul-12 22:07pm
   
You want to print the report viewer? Are you sure that's what you want to do?

1 solution

Edit: Sorry I wasn't familiar with rdlc report viewer. This should help you http://msdn.microsoft.com/en-us/library/ms252091.aspx[^]

This is how I have done it in the past. Not sure if you are using print document or not.
(I just quickly converted from VB.NET so hopefully I got the syntax all correct)

The key is the StandardPrintController.

PrintDocument1 = new PrintDocument();
PrintDocument1.DocumentName = "MyPrint";
PrintDocument1.PrinterSettings = ps;

StandardPrintController silentController = new StandardPrintController();
PrintDocument1.PrintController = silentController;

PrintDocument1.DefaultPageSettings.Margins.Top = 20;
PrintDocument1.DefaultPageSettings.Margins.Left = 20;
PrintDocument1.DefaultPageSettings.Margins.Right = 20;
PrintDocument1.DefaultPageSettings.Margins.Bottom = 20;

PrintDocument1.Print();
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900