Silent Parameters in SilverlightViewer (II)

Users of ActiveReports would surely agree to the fact that ActiveReports has been a revolution in terms of customizable Reporting component. ActiveReports in conjunction with default .NET libraries has been developer's delight irrespective of the domain whether it is Windows development, ASP.NET, WPF or be it Silverlight. With simple tweaking, it can be used to meet the develover's requirement. One such scenario has been the loading of ActiveReports in SilverlightViewer where the requirement is to pass the parameters silently without requiring end users to input the values. Implementation of the above scenario has already been discussed in one of my blogs where the similar requirement has been implemented for SectionReports. You can go through the article from this link. This blog discuss the same implementation for the developers working with PageReports. Difference between the two implementation lies only how the Parameter is fed into the PageReports. Before we look ahead with the implementation, lets quickly have a look at how the report would work in Silverlight Viewer.

Design the Silverlight Page

To begin with, create a Silverlight application with Web Project included. Add a ComboBox control and a SilverlightViewer object to the MainPage of the Silverlight project.

Add SectionReport to the Web Project

In this phase, you add a parameteric PageReport and design all the required fields. For details to design a parametric PageReport, you can refer this documentation link.

Working with Parametric WebForm

Similar to the SectionReports implementation, the core concept is to pass the parameter as query string to a web form which will run the reports object using the parametric query string in its datasource command. Report is saved in RDL format and returned back as stream to be consumed by the Silverlight Page. Add a web form 'ReportParameters.aspx'to the web project of the Silverlight application and use the code mentioned below. Following code block is the heart of this blog implementation.

This brings to the end of series of blogs where we have seen how the parameters can be passed to ActiveReports in SilverlightApplication without any user input. You can refer to the complete code implementation in the sample below. Download Sample