XML¶
Connect to an XML file so you can choose a repeating record element, build a query, and fill the report from those records.
Goal¶
Create a working XML connection in Connection Manager and use it as a report Data Source.
Prerequisites¶
- One
.xmlfile - A repeating element that holds one record, such as
/customers/customer
Steps¶
- Open Data → Connection Manager….
- Add a connection and choose XML.
- Browse to the file, or enter its path.
- Click Test. Test lists repeating record elements, such as
/customers/customer. - Choose the Record collection.
- Save the connection.
- On the Data tab, select the connection. Browse data and the collection, then open its columns.
- Open Query Builder, choose columns and filters, then Apply.
- Preview the rows, place fields on the report, then Preview.
[ Screenshot: XML connection settings ]
Notes¶
Note
Desktop keeps the selected file path. In the Web Designer, the uploaded file is stored with the data source.
Note
Attributes appear as column names that start with @, such as @id. Nested elements use dotted names, such as address.city.
Note
Filters are written in Query Builder. They are not XPath expressions.
Tip
Report parameters ($P{name}) can filter the query.
Result¶
The connection appears in Connection Manager. Query results become report fields.