Create the XML model and the report templates
The XML Model used as a data source for the content controls in the report template is created using the WorkZone Reports API and the information contained in the Report JSON file - specifically the OData queries and the names of the report templates (Word documents, and Excel spreadheets).
You can create the XML Model and the Word or Excel templates in one go or you can create an XML Model only and then use the XML Model in the Report templates (Word documents or Excel spreadsheets) you create afterwards.
Tip: Before you start, make sure the OData queries are valid and the OData URI is accessible.
Creating the XML Model
Open the WorkZone Reports API in a 3rd party Web debugger tool. While WorkZone allows you to access to the Reports API, there is no built-in application or program to manipulate the Reports API. You can use any 3rd party product to access the WorkZone Reports API, for example, Telerik Fiddler.
The GET action
Use the GET action of the Reports API and specify the URI of the Report JSON file that is to be used for the custom report as the parameter. The GET action of the Reports API only has this one parameter but if you do not specify the parameter correctly, the XML model and report template creation will fail.
When the GET action is executed, two things might occur, depending on the whether or not the report templates specified in the Report JSON in the FileName parameter exist in the same folder as the Report JSON file.
- If the folder containing the Report JSON file does not contain the report template(s) specified in the FileName parameter of the Report JSON, the report templates will be created with the XML Model embedded.
- If the folder containing the Report JSON file already contains the report template(s) specified in the FileName parameter of the Report JSON, the XML Model embedded in the report templates will be updated with the new XML Model.
Additional options
You can inspect the OData queries used in the Report API to create the XML model and to populate the report templates as well as display the XML Model generated by the Reports API by using the Accept header while making request to the Reports API.
The Accept header can be set to the following values:
- Text/Plain: Returns the OData queries used in the Report JSON file.
- Application/XML: Returns the XML model that will be generated by the GET action of the Report API.
Localizing the XML model
The generated XML Model can be localized based on the Accept-Language header value or the WorkZone Content Server language setting. The localization can be seen from the model's node names and default text inside content controls.