This tutorial describes how to use the DevExpress Template Gallery and .NET Core command line interface (CLI) to create a new ASP.NET Core application with the End-User Report Designer control.
See ASP.NET Core Reporting for general information about DevExpress Reporting in ASP.NET Core applications.
The Add a New Report to an ASP.NET Core Application tutorial provides instructions on how to add a report to an ASP.NET Core application.
Perform the following steps to create an ASP.NET Core application in Visual Studio:
Select FILE | New | Project in the main menu or press CTRL+SHIFT+N to create a new project.
In the invoked New Project dialog, select the Installed | Visual C# | Web category and the DevExpress v18.2 Template Gallery template.
Specify the application name and click OK.
In the invoked DevExpress Template Gallery, select Reporting Application under the NET Core category and click Create Project.
In the invoked DevExpress ASP.NET MVC Project Wizard, enable the Create Designer Page check box to add the Report Designer to the web application (the Designer.cshtml page).
You can add the Web Document Viewer and Report Designer to the application.
This page provides the following control options:
Click Create Project to complete the creation process.
Once Visual Studio created an application, right-click the Dependencies | npm folder in the Solution Explorer window and choose Restore Packages (you should run Visual Studio with administrator privileges).
The created project includes the registered ReportStorageWebExtension1 report storage. This storage provides reports added to the project at design time as embedded resources. At runtime, the Report Designer's Open Report dialog includes these reports.
You can specify a report to open in the Report Designer when the application starts. The following code demonstrates how to properly pass a report to the Report Designer's Bind method so that ReportStorageWebExtension1 can find the report in the project's resources:
@Html.DevExpress().ReportDesigner("reportDesigner").Height("1000px").Bind("FullReportTypeName")
The ReportStorageWebExtension1 storage saves the reports you change in the Report Designer to a dictionary. You can inherit your custom class from the abstract ReportStorageWebExtension class and implement logic to save reports to any other location.
Use the .NET Core command line interface (CLI) to create an ASP.NET Core Reporting application from the console:
Open the console and type the following command to install DevExpress CLI templates:
dotnet new -i "DevExpress.DotNet.Web.ProjectTemplates"
The console displays the list of templates installed on your machine after the installation command is finished.
Refer to the https://nuget.devexpress.com/#feed-url page and obtain the NuGet Feed URL. This URL includes your personal feed authorization key and is used to install NuGet packages that the Report Designer requires.
Use the command below to create a new project with the Report Designer and provide it with a sample data source. Pass the the NuGet Feed URL obtained above as a parameter.
dotnet new dx.reporting --nuget-feed https://nuget.devexpress.com/{auth_key}/api --name ReportDesignerApp --add-viewer false --add-data-source true
DevExpress Reporting templates have the following parameters:
Run the commands below to navigate to the created application's folder and download all the necessary client resources.
cd ReportDesignerApp
npm install
Install Node.js and npm if they do not exist on your machine.
Use the following commands to restore dependencies, build the application and get the application URL:
dotnet restore
dotnet run
Open your browser and insert the generated URL to see the result.