xtrareports-119825-web-reporting-knockout-reporting-report-designer-report-designer-integration-with-nodejs-package-manager.md
You can use the End-User Web Report Designer in a JavaScript application. You should create two projects:
You can use DevExpress CLI Templates to create an ASP.NET Core back-end application. Begin with the steps below:
Install DevExpress ASP.NET Core project templates from nuget.org:
Create a back-end Reporting application:
Enable cross-origin requests (CORS). Specify the policy that allows any local application to access the report’s back-end. Use the SetIsOriginAllowed method to set it up.
To run the server-side application, run the following command:
To create a back-end application from a Microsoft or DevExpress Template in Visual Studio, review the following help topics:
The following steps create the client part, install the required npm packages and create a bundle with Webpack:
Install Node.js and npm if they do not exist on your machine.
Install the Webpack CLI globally with the following commands:
Create a folder for a client-side project. In this example, the folder’s name is ClientSide.
Add a package.json configuration file to the created folder and list the following third-party packages the Web Report Designer requires:
Navigate to your folder, open the console and run the command below to install packages:
Create a webpack.config.js file and specify configuration settings as shown below. Define the index.js file as the bundle’s entry point (this file is created later) and the bundle.js file as the output file.
Create a View file (the index.html file in this example) and specify this View’s HTML template. In the body section, use the dxReportDesigner binding with the designerOptions parameter and link the bundle script file (bundle.js) specified in the previous step.
Add a new JavaScript file (index.js) to provide data to the View. Link the required modules, create a designerOptions variable and activate the Knockout bindings.
Create a new style.css file with the following content:
Run the following command to create the bundle:
Host your client-side part on the web server.
For the example to work correctly, you should first run a backend project in Visual Studio, and then, run a client part.
When you start the application, you may encounter the following problems:
The Report Designer page is blank. The following error message is displayed at the bottom of the page: The page is blank because the Report Designer failed to load the report. Consult the developer for assistance. Use development mode for detailed information.
Check the following:
/DXXRD/GetDesignerModel path; if you use the ASP.NET MVC backend, specify the /ReportDesigner/GetReportDesignerModel path.host setting of the Report Designer component.reportUrl value matches an existing report. For the back-end application, ensure that either the Reports folder contains a reportUrl.repx file or the ReportsFactory.Reports dictionary contains the reportUrl entry (if the back-end application originated from the DevExpress template).Refer to the following help topic for more information: Troubleshooting.