xtrareports-405351-web-reporting-blazor-reporting-web-report-designer-get-started-get-started-blazor-wasm-hosted.md
This tutorial adds a Report Designer (DxWasmReportDesigner) to an application created with the Blazor Web App (Interactive WebAssembly) template.
This section describes how to create a new Blazor project. If you wish to start this tutorial using an existing application, go to Step 2.
Click Create a new project on Visual Studio’s start page and select the Blazor Web App template. Select WebAssembly from the Interactive Render Mode drop-down list.
Specify the project name and location, and click Next.
Specify additional options and click Create.
You can use this tutorial to integrate the Standalone Report Parameters Panel into a Blazor WebAssembly Hosted (available in ASP.NET Core 7.0 or earlier) template.
For additional information on available Blazor templates, refer to the following help topic: Tooling for ASP.NET Core Blazor.
Install the following NuGet packages to the projects:
Build the project.
In the Program.cs file of the main project, add the following code:
In the _Imports.razor file of the main project, register the DevExpress.Blazor namespace:
In the App.razor file of the main project, call the RegisterScripts(Action<ResourcesConfigurator>) method to register DevExpress client resources:
Note
To perform this step, you should install DevExpress Reporting on your machine. Refer to the following topic for more information: Run the Installation Wizard - DevExpress Unified Component Installer.
Switch to the BlazorWasmReportingApp project. Select Project -> Add New Item… to invoke the Add New Item dialog. Navigate to the Reporting node and select the DevExpress v.25.2 Report item template.
Select Blank in the invoked Report Wizard page and click Finish.
Modify the newly created report in the Visual Studio Report Designer. Add a label and type Hello, World!:
Click the report’s smart tag and select Save… :
Implement the ReportStorageWebExtension descendant to save and load reports.
Add the ReportFactory.cs class file to the server project with the following code:
In the Program.cs file, register the ReportStorage service:
In the BlazorWasmReportingApp.Client/Pages folder, create a new Razor component (ReportDesigner.razor) with the following content:
@page "/designer"
@using DevExpress.Blazor.Reporting
@rendermode InteractiveWebAssembly
<DxWasmReportDesigner ReportName="TestReport" Height="700px" Width="100%" DevelopmentMode=true>
<DxWasmReportDesignerRequestOptions GetDesignerModelAction="DXXRD/GetReportDesignerModel">
</DxWasmReportDesignerRequestOptions>
</DxWasmReportDesigner>
The DxWasmReportDesigner component loads the TestReport report.
Modify the NavMenu.razor file to include links to the newly created page:
<div class="nav-item px-3">
<NavLink class="nav-link" href="designer">
<span class="oi oi-list-rich" aria-hidden="true"></span> Designer
</NavLink>
</div>
Run the project and see the result. The Report Designer displays the TestReport:
Use Data Sources Learn how to use data sources in the JavaScript-based Report Designer.Customize the Report Designer UI and Behavior
Refer to the following topics to learn how to customize the Report Designer UI and behavior:
TroubleshootingThis topic lists common issues that can occur in a Web Reporting application and describes solutions. For information on how to identify the cause of an issue, refer to the following topic: Reporting Application Diagnostics.