This commit is contained in:
@@ -41,21 +41,27 @@ In order to get up to speed quickly with report design we recommend looking over
|
||||
This section is provided to define the HTML Cascading Style Sheet for the report document. This section is optional.
|
||||
|
||||
|
||||
### JSPreRender
|
||||
### Prepare
|
||||
|
||||
This section is provided as a way to change the data provided to the report *before* it is rendered. You can use this section to alter data that is fed to the report template. Use of the reportPreRender function is optional but it *must* be present in it's default format even if not used as it is *always* called by the rendering process and will result in an error if missing.
|
||||
This section is provided as a way to change the data provided to the report *before* it is rendered.
|
||||
|
||||
Typically this function is used to retrieve and / or alter data that is fed to the report template.
|
||||
|
||||
Use of the `ayPrepareData` function is optional but the function *must* be present in it's default format even if not used as it is *always* called by the rendering process and will result in an error if missing.
|
||||
|
||||
This is the minimum required default definition:
|
||||
|
||||
```
|
||||
function reportPreRender(reportData) {
|
||||
return reportData;
|
||||
async function ayPrepareData(ayAllData) {
|
||||
return ayAllData;
|
||||
}
|
||||
```
|
||||
|
||||
Note that the SAMPLE DATA section of the user interface in the report designer shows the raw data *before* it is passed to this function, not how it would look *after* this function is run. If you need to see how the data is shaped after a reportPreRender you can make use of the `ayJSON` helper documented below to view the raw data on the rendered report itself.
|
||||
`ayAllData` parameter is an object containing all data provided for the report and is detailed below in the Report Data Objects section.
|
||||
|
||||
A common use for the reportPreRender function would be to insert or re-shape data based on calculations or data fetched from external API's or the AyaNova API itself (see the section regarding API usage below for details).
|
||||
Note that the SAMPLE DATA section of the user interface in the report designer shows the raw data *before* it is passed to this function, not how it would look *after* this function is run. If you need to see how the data is shaped after a ayPrepareData you can make use of the `ayJSON` helper documented below to view the raw data on the rendered report itself.
|
||||
|
||||
A common use for the ayPrepareData function would be to insert or re-shape data based on calculations or data fetched from external API's or the AyaNova API itself (see the section regarding API usage below for details).
|
||||
|
||||
### Helpers
|
||||
|
||||
|
||||
Reference in New Issue
Block a user