Bind a Report to JSON Data
This topic describes how to bind a report to JSON data.
Add a New Data Source
Invoke the designer menu and click Add Data Source....
This invokes the Data Source Wizard.
Choose the JSON option and click Next.
The next wizard page allows you to create a new data connection.
You can use a Web Service Endpoint, a filename, or a string with JSON data. In this example,
Specify request parameters (username and password, path parameters, query parameters, or HTTP headers).
- A path parameter appends a path element to a JSON endpoint's URI.
- A query parameter specifies a HTTP request parameter that is passed to a JSON endpoint.
- A header parameter adds a custom HTTP header to JSON endpoint requests.
You can click the parameter's button and use an expression to set the parameter value.
Click the Value property's ellipsis button. Specify the expression in the invoked Expression Editor and click OK.
Expressions can include report parameters. In the Expression Editor, expand Parameters, select a report parameter to which you want to bind the path parameter, query parameter, or header parameter, and click OK.
Note
The Data Source Wizard sends a request to the endpoint with the specified parameters to populate the data source and build the data source schema. Ensure that the parameters are always set to the values that the endpoint expects. Otherwise, the Data Source Wizard generates an error on the next steps.
For instance, if a user specifies the name of a JSON file in a parameter, specify the default file name in order to avoid an error.Path parameters, query parameters, and header parameters are included in endpoint requests in the same order as they are listed. Move a parameter up or down in the list to change its position in endpoint requests.
The Resulting URI read-only field shows how the resulting JSON URI looks.
This wizard page also shows the specified JSON data's structure. You can choose all nodes or a subset of nodes.
Uncheck the data fields that your report does not require.
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.
Customize the JSON Data Source Schema
Choose the JsonDataSource component in the Field List and click Edit Schema.... Reconfigure data fields in the invoked wizard page.