Richard Dudley

Pencil Bros. Geology, Inc. "We Deliver" Quality Assured * Satisfaction Guaranteed

<December 2008>
SuMoTuWeThFrSa
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910


Navigation

Pittsburgh Dot Net

Crystal Reports .NET

Subscriptions

Post Categories

Article Categories



Automatically Printing Crystal Reports in ASP.NET

My second Crystal Alliance article was published today:

Automatically Printing Crystal Reports in ASP.NET
source: http://aspalliance.com/509

Unlike the Windows Forms CrystalReportViewer toolbar, the web-based CrystalReportViewer toolbar does not include a print button.  For reports that are directly rendered as HTML, the user can simply use the browser's print button.  For reports rendered as PDF or Excel, the user can use the print functionality in either the Acrobat Reader or Excel to print the report.

Most users can figure out how to print the report, but some still need a little help, and in some cases, clients request this as part of their application specs.  In this article, we'll review two methods for automatically printing a Crystal Report using the web-based CrystalReportViewer:  the server side ReportDoucment.PrintToPrinter method, and a small client-side JavaScript that uses the window.print method.  We'll also discuss rendering a report in PDF and allowing the user to print that document as an alternative to the two other methods.  Because of the disconnected nature of web client applications, and security considerations, there isn't a perfect way to make every web-based Crystal Report automatically print.  But, under certain conditions, we can provide this functionality in user-friendly ways.

posted on Wednesday, September 01, 2004 4:47 AM by richard.dudley





Powered by Dot Net Junkies, by Telligent Systems