Once you have configured a valid XML File data source, the Configure XML Queries screen allows you to add one or more queries to the XML data contained in the file.
You can add and remove Queries by using the Add and Remove buttons below the list on the left side of the screen. At least one query is required to complete proceed to the next steps.
Each query has the Name property that is the unique ID of the query and the Path property that is a XPath expression that is used to select the repeating nodes from the XML data to visualize them in a report.
You can set the XPath in the XML data tree by clicking the corresponding node, or you can enter the XPath expression manually in the Query textbox. Here are several examples of XPath Expressions.
For more details on XPath syntax, you can refer to the official XPath specification.
You could also make a query dynamic by using parameters in the path expression. Parameters are dynamic values that are either supplied programmatically via your application's code or provided by the report reader through user input. To insert a parameter into an XPath expression, click the Insert parameter... link below the Query textbox. The Parameters dialog will appear:
Here, you can re-use an existing parameter or create a new one by clicking the Add button. The following parameter properties can be configured:
Once you click the OK button, the reference to the selected parameter will be inserted into the path expression. For example, it will be updated to /Customers/Customer[address/country={country}], which filters the data by country using a dynamic value.
Once you have configured one or more queries, click Finish >> to create a report with data binding configured, or click Next > to add a data display control.