0
votes

I would like to know if exists the way to send a crystal report directly to the printer without print dialog. Ex. I have an asp.net page with a crystal report viewer and I want send to print once the report have been loaded into the viewer.

I saw an application what it is doing that but I don't know how that work.

I am using

  • Visual Studios 2010
  • Crystal Report for .NET Framework (Version=13.0.2000.0)
  • C# 4

if have a code sample (will be great!!!!)

I have read lot of resources in internet but nothing give me idea how to do what I need.

Thanks in Advance.

J.S.

2

2 Answers

1
votes

It does not working like you think. Method PrintToPrinter generates printout directly to printer. Report preview also do the same. If you are executing both methods then report is generating twice. If you have more pritnout pages then report preview generates only visible pages. In most cases this does not change anything, but if report is generating a lot of time, then you are getting a lot of resources from system and you can expect deadlock on database. You also have to remember that if your report is generating new data per each executing then you will have doubled data.

0
votes

Good I did it

I Just set this values to the ReportDocument.

CrystalReportDocument.PrintOptions.PrinterName = "Printer Name"; CrystalReportDocument.PrintToPrinter(1, true, 1, 1);

anyways I am open to other ideas and suggestion.