Overview
A report template is a JSON formatted document that defines the metadata, options, content and layout of a report. The template should include basic details about the report such as name, id, description, creator and version. The options section defines layout details and other settings that apply to the entire document such as orientation, styles, and margins. The components section is where you define the content and layout of the report.
Report Schema
| key | type | required | description |
|---|---|---|---|
| id | string |
required | A unique identifier for the report template. It is not included anywhere in the report. Used for tracking purposes only. |
| name | string |
required | A name for the report template. The name is not included in the report. |
| components | Component[] |
required | An array of components that will make up the layout of the report. |
| description | string |
optional | A description of the report template. |
| creator | string |
optional | The name of the report template creator. |
| version | string |
optional | The version of the report template. |
| metadata | KeyValue[] |
optional | An array of key value pairs to include as metadata of the generated report. Values in the array support text substitution from the report data using syntax $(DATA_ELEMENT_ID). |
| debug | boolean |
optional | If true, enables highlighting of all components in the report. Useful for debugging layout issues. |
| previewerOptions | PreviewerOptions |
optional | Customize how the Live Previewer handles report rendering. |
| customProperties | object |
optional | An optional object containing arbitrary data used to track a report template. Data in this object is not validated and has no impact on report rendering. |
| externalOptions | ExternalReportOptions[] |
optional | Allows for loading external report option files. This is a powerful way to share Styles across many different report templates. |
| conditionals | Condition[] |
optional | An array of conditionals to use in the report. |
| options | ReportOptions |
optional | Sets various options to use when rendering the report. |
Basic report template example
{
"id": "JHA-EA-RPT-1",
"name": "Report 1",
"description": "My first report",
"creator": "Aaron Watson",
"version": "1.0",
"options": {
"defaultTextOptions": {
"font": "arial",
},
"margins": {
"top": 10,
"left": 10,
"bottom": 10,
"right": 10
}
},
"components": [
{
"type": "Text",
"text": "Report Title"
}
]
}
Components
The content of a report is broken down into individual components. Components are a set way of organizing and displaying content on a page. Components can be combined together in various ways to achieve the overall data presentation required for a report. There are three types of components: Content, Layout and Chart.
Content Components
Content components display the actual content of a report. The following links describe each type of content component and its options:
Layout Components
Layout components control how content components are arranged when rendering a report. Most layout components contain other components and control how and where they are placed in the report. The following links describe each type of layout component and its options:
Chart Components
Chart components are used to visualize data in a report. Data for a chart is retrieved from the JSON data file using JSONata queries. The following are the available chart types: