xtrareports-401256-web-reporting-knockout-reporting-report-designer-report-designer-integration-with-npm-yarn.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 describe how to configure and host the client part:
Create a new folder to store the client-side files (ClientSide in this example).
Create a package.json configuration in the ClientSide folder with the following content:
Ensure that you have npm or Yarn package managers installed.
Navigate to the client application’s root folder and run the following command to install packages:
Create a index.html file in the root folder. It is the View file in our model. Copy the following HTML code and insert it in this file:
Create a example.js file in the root folder to provide data to the View. The JavaScript code in this file creates a designerOptions variable and activates the Knockout bindings. Copy the following code and insert it in the example.js file:
Modify the index.html file to specify the HTML template that uses the dxReportDesigner bindings with the designerOptions object as a parameter. Add the following code to the body section:
Host the client-side part on the web server. Start the Internet Information Services (IIS) Manager, right-click the Sites item in the Connections section, and select Add Website. In the invoked dialog, specify the site name, path to the client-side application root folder, and the website’s IP address and port.
Run the backend project.
Open the website created in step 8, in the browser. In this example, the address is http://localhost:1000.
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.