Back to Devexpress

Report Designer Integration (npm or Yarn Package Managers)

xtrareports-401256-web-reporting-knockout-reporting-report-designer-report-designer-integration-with-npm-yarn.md

latest5.4 KB
Original Source

Report Designer Integration (npm or Yarn Package Managers)

  • May 27, 2025
  • 6 minutes to read

You can use the End-User Web Report Designer in a JavaScript application. You should create two projects:

  • A server (backend) project that enables Cross-Origin Resource Sharing and retrieves a report from the storage
  • A client (frontend) part that includes all the necessary styles, scripts, and HTML-templates.

View Example

Server (Backend) Part

Use the DevExpress CLI Template

You can use DevExpress CLI Templates to create an ASP.NET Core back-end application. Begin with the steps below:

  1. Install DevExpress ASP.NET Core project templates from nuget.org:

  2. Create a back-end Reporting application:

  3. 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.

  4. To run the server-side application, run the following command:

Use Visual Studio Template

To create a back-end application from a Microsoft or DevExpress Template in Visual Studio, review the following help topics:

Client (Frontend) Part

The following steps describe how to configure and host the client part:

  1. Create a new folder to store the client-side files (ClientSide in this example).

  2. Create a package.json configuration in the ClientSide folder with the following content:

  3. Ensure that you have npm or Yarn package managers installed.

  4. Navigate to the client application’s root folder and run the following command to install packages:

  5. 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:

  6. 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:

  7. 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:

  8. 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.

  9. Run the backend project.

  10. Open the website created in step 8, in the browser. In this example, the address is http://localhost:1000.

Troubleshooting

When you start the application, you may encounter the following problems:

Page Is Blank

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:

  • The backend application is up and running.
  • The specified controller action path matches the back-end application type. If you use the ASP.NET Core backend, specify the /DXXRD/GetDesignerModel path; if you use the ASP.NET MVC backend, specify the /ReportDesigner/GetReportDesignerModel path.
  • The backend application runs on the port specified in the host setting of the Report Designer component.
  • The application’s URI satisfies the CORS policy specified in your back-end application.
  • The 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).
  • The version of DevExpress npm packages should match the version of NuGet packages. Enable Development Mode to check for library version mismatch on every request to the server. For details, review the following help document: Server-Side Libraries Version.

Refer to the following help topic for more information: Troubleshooting.