Skip to main content
A newer version of this page is available. .

Bind a Report to JSON Data

  • 2 minutes to read

This topic describes how to bind a report to JSON data at design time.

Create a Project and Prepare a Data Source

To get started with this tutorial, open an existing reporting application or create a new application (the Add a Report to Your .NET Application section explains how to create a reporting application on different platforms).

  1. Add a new blank report to your application.

  2. Click the report’s smart tag. In the invoked actions list, expand the drop-down menu for the DataSource property and click Add Report Data Source…

    how-to-ef-datasource01

    This invokes the Data Source Wizard.

  3. Choose the JSON option and click Next.

    JSON-SelectJSONDataSource

    Note

    The End-User Report Designer‘s Report Wizard provides the JSON option if the application references the open-source Newtonsoft.Json library.

  4. The next wizard page allows you to specify a Web Service Endpoint URI, a filename or a string with JSON content.

    Note

    DevExpress Reporting uses the open-source Newtonsoft.Json library to provide JSON data at runtime. The wizard detects whether your project references this library and suggests to install the required NuGet package if necessary.

    JSON-Newtonsoft

  5. On the next page, the wizard shows the specified JSON data’s structure. You can choose all nodes or a subset of nodes.

    JSON-SelectRootElement

    Uncheck the data fields that your report does not require.

    You can rename data fields if necessary.

    JSON-EditFieldNames

After you finish the wizard, it creates the JsonDataSource component. This component retrieves the checked data fields that the selected JSON element includes. The Field List reflects the data source structure.

JSON-FieldList

Customize the JSON Data Source

Right-click the JsonDataSource component in the Field List or Report Explorer and choose Edit…. Specify another JSON data location and reconfigure data fields in the invoked wizard.

JSON-FieldList

Customize the JSON Data Source Schema

Right-click the JsonDataSource component in the Report Explorer and choose Edit Schema…. Reconfigure data fields in the invoked wizard page.

JSON-EditSchema