Joel Santos
Joel Santos

Reputation: 49

ASP.NET Crystal Report Print Automatically

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

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.

Upvotes: 0

Views: 3592

Answers (2)

LosDavidos
LosDavidos

Reputation: 31

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.

Upvotes: 1

Joel Santos
Joel Santos

Reputation: 49

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.

Upvotes: 0

Related Questions