Exporting PDF Reports
The report functionality allows users to export individual views of a workbook, the content of an individual worksheet and, if available, reports prepared for the workbook as a PDF report. These reports are paginated reports, which means that they ideally fit on one or, especially in the case of tables, several printed pages. The layout of a report page, such as the page format, header and footer, etc., is defined using report layouts.
Cadenza uses WebDriver technology to generate the reports. WebDriver technology is a W3C default that enables the programmatic remote control of a web browser.
Requirements
-
WorkbookReport plugin activated
-
workbookreport settings adjusted
-
When installing using the ZIP file, a headless Chromium is included. Alternatively, a Selenium Grid can be used as a remote WebDriver application. This must use the stable Chromium version that Cadenza expects. For Cadenza beeing operated in a container, the required version can always be retrieved from its image metadata:
docker inspect \ --format '{{index .Config.Labels "net.disy.cadenza.webdriver-chrome-version"}}' \ <image-repository>:<image-tag>
|
To display layers from a geodata service in PDF reports, the WebDriver application must have access to the geodata service. Hint for WMS/WMTS layers: If the WebDriver application does not have access to the geodata service, access via the Cadenza server can be enforced in the Management Center for WMS/WMTS data sources. |
Adjusting the Configuration
To export PDF reports, the workbookreport settings must be configured according to the following example:
-
XML
-
YAML
-
Environment Variables
workbooktable-config.xml configuration fileEither localWebDriver or remoteWebDriverUrl
<workbookReportConfiguration>
<localWebDriver>
<webDriverExecutable>$SYSTEM{CADENZA_CHROMEDRIVER_EXECUTABLE}</webDriverExecutable>
<webDriverBrowserExecutable>$SYSTEM{CADENZA_CHROME_EXECUTABLE}</webDriverBrowserExecutable>
<webDriverPort>12345</webDriverPort>
</localWebDriver>
<webDriverWaitTimeout>PT5M</webDriverWaitTimeout>
<threadCount>1</threadCount>
<cadenzaUrl>http://localhost:8000/cadenza</cadenzaUrl>
</workbookReportConfiguration>
<workbookReportConfiguration>
<remoteWebDriverUrl>http://localhost:4444</remoteWebDriverUrl>
<webDriverWaitTimeout>PT5M</webDriverWaitTimeout>
<threadCount>1</threadCount>
<cadenzaUrl>http://localhost:8000/cadenza</cadenzaUrl>
</workbookReportConfiguration>
myConfig.yamlcadenzaconfig:
...
workbookreport:
localWebDriver:
webDriverExecutable: $SYSTEM{CADENZA_CHROMEDRIVER_EXECUTABLE}<
webDriverBrowserExecutable: $SYSTEM{CADENZA_CHROME_EXECUTABLE}
webDriverPort: 12345
webDriverWaitTimeout: PT5M
threadCount: 1
cadenzaUrl: http://localhost:8000/cadenza
...
cadenzaconfig:
...
workbookreport:
remoteWebDriverUrl: http://localhost:4444
webDriverWaitTimeout: PT5M
threadCount: 1
cadenzaUrl: http://localhost:8000/cadenza
...
Be sure to make the executables actually executable, i.e. on Linux chmod +x.
|
About the Report Generation Process
The user first initiates the creation of his report from the Cadenza client. The Cadenza server then prompts the configured WebDriver application to show the report pages and export them as a PDF. The report pages themselves are created by another Cadenza instance to which the user is automatically logged in. The report is finally made available to the user as a PDF document on the Cadenza client.
Even if this architecture is distributed, the Cadenza instance(s) and the WebDriver server can also run on the same computer.