This section explains you the steps required to create your first UWP reporting application to display an already created SSRS RDL report in the Bold Reports® UWP Report Viewer without using a Report Server.
To get start quickly with Report Viewer, you can check on this video:
Open Visual Studio 2022 and click Create new project.
Choose Blank App (Universal Windows), and then click Next.
Change the project name, and then click Create.
Select the below image target and minimum platform version from the dropdown, and then click OK.
Set the same version for the target and the minimum platform version.
Right-click the project or solution on the Solution Explorer tab and choose Manage NuGet Packages. Alternatively, select Tools > NuGet Package Manager > Manage NuGet Packages for Solution.
Refer to the NuGet Packages to learn more details about installing and configuring Report Viewer NuGet packages.
Search for BoldReports.UWP
NuGet package and install them in your UWP application.
Package | Purpose |
---|---|
BoldReports.UWP |
Contains UWP Reporting controls (Report Viewer and Report Writer) to preview and export the reports. |
Open the MainPage.xaml
file and import the Report Viewer namespace as shown below,
xmlns:BoldReports="using:BoldReports.UI.Xaml"
Initialize the Report Viewer component inside the <Grid>
tag as shown below in the MainPage.xaml
file,
<Page
....
....
....
xmlns:BoldReports="using:BoldReports.UI.Xaml"
....>
<Grid>
<BoldReports:ReportViewer Name="ReportViewer"/>
</Grid>
</Page>
The Report Viewer requires a Web API service to process the RDL report files. You can skip this step and use the online Web API services to preview the already available reports or you should create any one of the following Web API services:
If you have created a new service, you can add the reports from the Syncfusion® installation location. For more information, refer to the samples and demos section.
Create a folder Resources
in your Web API application to store RDL reports and add the already created reports to it.
Add already created reports to the newly created folder.
In this tutorial, the
sales-order-detail.rdl
report is used, and it can be downloaded at this link.
Refer to the create RDL report section for creating new reports.
Open the MainPage.xaml.cs
file.
Initialize the window loaded event inside the MainWindow()
constructor.
public MainPage()
{
this.InitializeComponent();
this.Loaded += MainPage_Loaded;
}
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
}
Set the ReportPath
and ReportServiceUrl
properties in the MainWindow_Loaded
event method and invoke the RefreshReport()
method to render the report.
You can replace the following code in your MainWindow_Loaded
event method.
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
this.ReportViewer.ReportPath = "~/Resources/docs/sales-order-dtail.rdl";
this.ReportViewer.ReportServiceURL = @"https://demos.boldreports.com/services/api/ReportViewer";
this.ReportViewer.RefreshReport();
}
In the above code, the
sales-order-detail.rdl
report andreportServiceUrl
used from online URL.
Build and run the application to view the report output in the Report Viewer as displayed in the following screenshot.
Note: You can refer to our feature tour page for the UWP Report Viewer to see its innovative features.