Use DevExpress Project Templates to Create a Blazor Reporting Application (.NET CLI)
- 4 minutes to read
You can use the .NET command line interface (CLI) to create an ASP.NET Core Reporting application from the console:
Prerequisites
You need a configured private DevExpress NuGet source to create an application using the .NET CLI Tools.
If you have already configured a private DevExpress NuGet source, proceed to step 1. Otherwise, add a private DevExpress NuGet source as described in the following help topic: Manage Packages with .NET CLI.
Step 1. Install DevExpress CLI Templates
Open the console and enter the following command:
dotnet new install DevExpress.DotNet.Web.ProjectTemplates::24.1.7
The console displays the list of templates installed on your machine from this package.
Step 2. Create a Blazor Reporting Application
Generate a Blazor Server Reporting Application
Run the following command to generate an application:
dotnet new dx.blazor.reporting.blazorserver --name BlazorReportingServerApp
Generate a Hosted Blazor WebAssembly Reporting Application
Run the following command to generate an application:
dotnet new dx.blazor.reporting.webassembly.hosted --name BlazorReportingWasmHostedApp
Generate a Blazor WebAssembly Reporting Application
Run the following command to generate an application:
dotnet new dx.blazor.reporting.webassembly --name BlazorReportingWasmApp
Command Options
Specify the following command line parameters to customize the project:
-nf, --nuget-feed <nuget-feed>
- Specifies the NuGet Feed URL. Refer to https://nuget.devexpress.com/#feed-url and login to your account to obtain your Feed URL.
-ad | --add-designer
(optional)- Specifies whether to create a web page with the Report Designer (JS-Based). The default value is
true
. -adv | --add-document-viewer
(optional)- Specifies whether to create a web page with a Document Viewer (JS-Based). The default value is
true
. -arv | --add-report-viewer
(optional) (only Blazor Server and Blazor Webassembly standalone)- Specifies whether to create a web page with a Report Viewer (a native Blazor component). The default value is
true
. -ads | --add-data-source
(optional) (only Blazor Server and Blazor Webassembly Hosted)- Specifies whether the application should register a sample connection string. The specified connection allows end users to create SQL Data Sources in the Report Wizard and Data Source Wizard. The default value is
true
. -ajs | --add-json-data-connection-storage
(optional)- Specifies whether the application should create and register a JSON storage. That storage allows users to create JSON Data Sources in the Report Wizard and Data Source Wizard. The default value is
false
. -ao | --add-data-object
(optional) (only Blazor Server and Blazor Webassembly Hosted)- Specifies whether the application code should create and register a sample data object. Data objects allow users to create Object Data Sources in the Report Wizard and Data Source Wizard. The default value is
false
. -dfb, --Dockerfile <None|Debian|...>
(optional) (only Blazor Server and Blazor Webassembly Hosted)Creates a Dockerfile based on the selected OS. Review the following online example for more information: How to Use the DevExpress CrossPlatform Drawing Engine in an ASP.NET Core Application. Select
None
to not enable Docker support.- None (defaut)
- Skip docker support.
- Debian
- Debian-based Dockerfile.
- Alpine
- Alpine-based Dockerfile.
- Ubuntu
- Ubuntu-based Dockerfile.
- openSUSE
- openSUSE-based Dockerfile.
- Amazon Linux
- Amazon Linux based Dockerfile.
-f, --framework <net6.0|net7.0|...>
- Specifies the target framework for the project.
- net6.0 (default)
- The target framework is .Net6.0
- net7.0
- The target framework is .Net7.0
- net8.0
- The target framework is .Net8.0
Step 3. Run the Application
Blazor Server Reporting Application
Navigate to the application folder and download client resources.
cd BlazorReportingServerApp npm install
Restore dependencies, build the application, and run the project:
dotnet run
The command output contains the application URL:
Now listening on: http://localhost:5000
Open your browser and navigate to the URL to see the result.
Blazor WebAssembly (Hosted) Reporting Application
Navigate to the application folder:
cd BlazorReportingWasmHostedApp
Restore dependencies, build the application, and run the project:
dotnet run --project BlazorReportingWasmApp.Server
The command output contains the application URL:
Now listening on: http://localhost:5000
Open your browser and navigate to the URL to see the result.
Blazor WebAssembly (Standalone) Reporting Application
Navigate to the application folder:
cd BlazorReportingWasmApp
Restore dependencies, build the application, and run the project:
dotnet run
The command output contains the application URL:
Now listening on: http://localhost:5000
Open your browser and navigate to the URL to see the result.
Troubleshooting
The following article lists common issues that can occur in a Web Reporting application and describes solutions: Troubleshooting
For information on how to identify the cause of an issue, refer to the following topic: Reporting Application Diagnostics.