You can provide PDF printing in your Silverlight project, which allows to print a document from Silverlight to the PDF format directly. This is a good alternative to the default Silverlight printing with its large print spool size issue.
Note: The PDF printing only works for reports that are loaded from a static RDF file (except RDF files saved on the client side) and an RPX handler. As for reports loaded from a document stream (aspx page) and WCF service, the PDFPrint property is ignored. |
If PDF printing was set up in the Silverlight project, you will see this Print dialog by clicking Print in the Silverlight Viewer toolbar:
Note: When you print to PDF, the exceptions that occur at printing cannot be caught. Thus, if there is a printing exception, no Print dialog appears after clicking Print in the Silverlight Viewer toolbar. |
If your Web browser does not support JavaScript and Acrobat or Adobe Reader, the Silverlight Viewer will use its default printing instead of the pdf printing.
Note: PDF printing is not supported in the Silverlight Out-of-Browser applications. |
XML code. Paste in the XML view of the Web.config file inside the system.web section. |
Copy Code |
---|---|
<httpHandlers> <add verb="*" path="*.rpx" type="DataDynamics.ActiveReports.Web.Handlers.RpxHandler, ActiveReports.Web, Version=6.2.3118.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" /> <add verb="*" path="*.ActiveReport" type="DataDynamics.ActiveReports.Web.Handlers.CompiledReportHandler, ActiveReports.Web, Version=6.2.3118.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff" /> |
Note: You should update the Version and PublicKeyToken values to reflect the current version of ActiveReports installed on your machine. You can find the Version and PublicKeyToken values in the Global Assembly Cache (GAC), C:\WINDOWS\ASSEMBLY. |
Paste to MainPage.xaml.cs to the viewer1_Loaded event |
Copy Code |
---|---|
viewer1.ViewModel.PdfPrint = true; |