Back to Devexpress

Create a React Front-End Application with a Report Designer (Next.js)

xtrareports-119339-web-reporting-react-reporting-report-designer-report-designer-integration-react-nextjs.md

latest5.6 KB
Original Source

Create a React Front-End Application with a Report Designer (Next.js)

  • Mar 24, 2025
  • 5 minutes to read

Important

Familiarity with React basic concepts and patterns is essential prior to the use of this documentation. If you require a review, please refer to React documentation for a getting-started tutorial

The Web Report Designer is used in applications that contain client and server parts:

ClientA Web Report Designer integrated in a client React application displays a report provided by the server-side model.ServerThe server is an ASP.NET Core application that handles client data requests and provides access to data sources, report storage, and other back-end capabilities.

This tutorial creates and configures a client React application and a server ASP.NET Core backend. The client is created with the help of Next.js and contains the Web Report Designer control.

View Example

Tip

You can also use our DevExpress project templates to create a React Reporting application:

Prerequisites

Note the following details about package versions:

  • The script version on the client should match the library version on the server.
  • DevExpress npm package versions should be identical.

Create a Server Application (Back-End)

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:

Create a Client Application (Front-End)

  1. In the command prompt, create a React application with Next.js:

  2. Navigate to the project folder:

  3. Install the devexpress-reporting-react npm package:

  4. Open the app/page.tsx file and substitute its contents with the following code excerpt:

Run the Project

  1. Run the server application.

  2. Run the client application:

  3. Open the http://localhost:3000/ in your browser to see the result:

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.

See Also

Next.js Documentation