GrapeCity ActiveReports Part 2: Run a Silverlight Report
This is the second in a series of ActiveReports Blogs and is a continuation of Part 1.
ActiveReports Script 2 – Running a Silverlight Report
1. In MainPage.XAML.CS add the line below to Public MainPage
namespace SilverlightApplication1
{
public partial classMainPage : UserControl {
publicMainPage()
{
InitializeComponent();
viewer1.ViewModel.LoadDocument.Execute(new Uri ("../ActiveReport1.rpx", UriKind.RelativeOrAbsolute));
}
}
}
2. Rebuild Solution.
3. In the web project right click and View Silverlight1TestPage.aspx (It may fail, but this is ok at the moment)
4. Change the url in the browser to http://localhost:xxxxx/Activereport1.rpx and you will see the report in plain html… (no viewer) .. xxxxxx= localhost. Also, the plain html is the report document getting exported to HTML and then displayed in the browser.
4. The handler itself has output formats, append to the url in the browser… ?OutputFormat=PDF , and you will see a PDF version appear! The report document was exported to pdf and then rendered in the browser.
http://localhost:xxxxx/Activereport1.rpx?OutputFormat=PDF
5. We will use RDF3, a binary format for the viewer
?OutputFormat=RDF3
6. Modify the line of code in our code behind to use the RDF3 format
viewer1.ViewModel.LoadDocument.Execute(new Uri("../ActiveReport1.rpx?OutputFormat=RDF3", UriKind.RelativeOrAbsolute));
7. Run the project and see the viewer control pull up the report…
We will tour the Silverlight Viewer tool bar and get rid of the red license message in Part 3.
Technorati Tags: ActiveReports,Getting started,grapecity,reporting components,DataDynamics,multi-part series,AR Tutorial,AR,AR Script,Tutorial,Script
tweetmeme_url = 'http://www.clubfarpoint.com/Forums/blogs/russells\_blog/archive/2012/01/04/grapecity-activereports-part-2-run-a-silverlight-report.aspx'; tweetmeme_source = '@russcamtv'; tweetmeme_hashtags = '#appdev';