GrapeCity ActiveReports Part 7: PDF and Silverlight Printer Support
ActiveReports Script 7 – PDF and Silverlight Printer Support
This is the 7th in a series of ActiveReports Blogs and is a continuation of:
Part 1 Getting StartedPart 2 Run a reportPart 3 Silverlight Viewer ToolbarPart 4 Uploading reports to Silverlight ViewerPart 5 Documentation TipsPart 6 Silverlight Viewer Theme Customization
- ActiveReports supports native Silverlight API printing. Many find this nice, but simply put, reports are fat and could be a concern to print spoolers. We will reduce spooler size from the default Silverlight printing by using PDF Printing. Using our existing project we have developed in Parts 1-6, run the app and press the printer Icon…
- See native print dialog for the Silverlight API and select the Microsoft XPS Document Writer…
- Save to a folder when prompted as LargeNativeSilverlight.xps and close the browser.
Insert these lines in web.config in the
section in <system.web>, replacing the PublicKeyToken with your own (see: C:\Windows\assembly ) In mainpage.xaml, add this line before the execute line to enable PDF Printing.
public MainPage()
{
InitializeComponent();
viewer1.ViewModel.PdfPrint = true;
viewer1.ViewModel.LoadDocument.Execute(new Uri("../ActiveReport1.rpx?OutputFormat=RDF3",UriKind.RelativeOrAbsolute));
}
Run the App and Print. It will now show printer dialog using PDF api…
- Print to Microsoft XPS Document Writer. When prompted, save with different file, such as SmallPDF.xps, to the same folder as above.
- See difference in size… it is huge. In this case, it’s 4,934 KB (Silverlight) vs. 129 KB (PDF). Yikes! Pretty significant savings, huh?
In part 8 we will cover Localization Support.
Technorati Tags: ActiveReports,Getting started,grapecity,reporting components,DataDynamics,multi-part series,AR Tutorial,AR,AR Script,Tutorial,Script,part 6,license message,toolbar,documentation,help,metro,blend,Silverlight,themes,theme customization,contest,kindle Fire,printing,Silverlight API,PDF Print support
tweetmeme_url = 'http://www.clubfarpoint.com/Forums/blogs/russells\_blog/archive/2012/01/16/grapecity-activereports-part-7-pdf-and-silverlight-printer-support.aspx'; tweetmeme_source = '@russcamtv'; tweetmeme_hashtags = '#appdev';