0

i have an ASP.Net application with crystal reports. when i click on the print icon on the viewer, export to PDF appears. i added a button to custom print the generated report.

System.Drawing.Printing.PrintDocument cprPrinter = new System.Drawing.Printing.PrintDocument();
reportDocument.PrintOptions.PrinterName = cprPrinter.PrinterSettings.PrinterName;
reportDocument.PrintToPrinter(0, false, 0, 0);

what's happened when i published site on the iis server, "cprPrinter.PrinterSettings.PrinterName" take the server default printer not the client.

How can we access the client default browser to auto print report on click on the button, or print dialog appears?

Georgian Citizen
  • 3,727
  • 6
  • 38
  • 46

2 Answers2

0

As far as I know, it must bring up the dialog to print so that you grant it access

Armee
  • 11
  • 5
0

did you tried this one, hope this can help you.

          crystalReport.PrintOptions.PrinterName = GetDefaultPrinter();
          crystalReport.PrintToPrinter(1, false, 0, 0);