Query Builder in JSON and XML Providers
In This Topic
ActiveReports provides query builders for some providers that assist in generating complex queries conveniently. This article demonstrates using the query builders for designing queries for JSON and XML providers.
Designing queries in JSON Query Designer
Follow the below steps to build a query using the JSON Query Designer. Our report already connects to the 'customers.json' data source available on GitHub.
- In the Report Explorer, right-click an existing data source and select the Add Data Set option.
- In the DataSet dialog box that appears, select the General page and enter the name of the dataset. By default, the dataset name is set to DataSet1.
- Navigate to the Query page and click the Edit with JSON Query Designer icon to open the JSON Query Builder.
- Select a node from the data tree to generate the JSON path. The resulting JSON path is displayed at the bottom of the query builder.
- If you want to select multiple nodes and create separate datasets for each node, check the Allow to select multiple nodes and create separate dataset for each node option.
- Click the OK button to save the query.
- Verify the query by clicking the Validate DataSet icon. You can go to the Fields page to view the dataset fields fetched from the generated query.
- Click the OK button to close the DataSet dialog box and complete adding a dataset.
Designing queries in XML Query Designer
Follow the below steps to build a query using the XML Query Designer. Our report already connects to the 'factbook.xml' data source available on GitHub.
- In the Report Explorer, right-click an existing data source and select the Add Data Set option.
- In the DataSet dialog box that appears, select the General page and enter the name of the dataset. By default, the dataset name is set to DataSet1. This name appears as a child node to the Data Source node in the Report Explorer.
- Navigate to the Query tab and click the Edit with XML Query Designer icon to open the XML DataSet Query Builder.
- Select a node from the data tree to generate the XML path. The resulting XML path is displayed at the bottom of the query builder.
- Click the OK button to save the changes.
- Verify the query by clicking the Validate DataSet icon in the DataSet dialog box. You can go to the Fields page to view the dataset fields fetched from the generated query.
- Click the OK button to close the DataSet dialog box and complete adding a dataset.
See Also