Class ReportRenderer
The server opens the report's page in headless Chrome and the page renders itself, so the files match what a person viewing the report as the same user would see, with the same declarative security and field masking. Requires the WebDriver support jar, a Chrome install, and reportRender.baseUrl in server.properties; see the "Report Delivery and Scheduling" overview in the Client Reference for all settings.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThrown when a render could not start because the server was already running as many renders asreportRender.maxConcurrentallows, for longer thanreportRender.maxWaitSeconds.static final classstatic final classThe outcome of one render:files, the files produced by format, andproblems, a readable reason for each requested format that could not be produced.static classThrown when this server cannot render reports at all (no headless Chrome support). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanWhether this server can render reports: headless page capture is installed.static ReportRenderer.ResultRender a deployed report.
-
Field Details
-
FORMATS
Formats a report can be rendered to:png(a snapshot of the report),xlsx(the data behind each component, one sheet each) andpdf(the report's print layout).
-
-
Method Details
-
isAvailable
public static boolean isAvailable()Whether this server can render reports: headless page capture is installed. -
render
public static ReportRenderer.Result render(String reportPath, List<String> formats, Map options) throws Exception Render a deployed report.The page is loaded from
reportRender.baseUrlplusreportPath, which must be a report page (reportRender.reportPathPattern). With therunAsoption the page is viewed as that user: the browser is logged in with a one-time token valid only for this page, and visitsreportRender.logoutPathafterwards; the report page must be protected by SmartClient'sAuthenticationFilterfor the login to take effect. WithoutrunAsthe page is viewed with no logged-in user.- Parameters:
reportPath- path of the report page on this server (a schedule's deployedUrl)formats- any ofFORMATSoptions- optional:viewportWidthandviewportHeight(pixels) for the browser window;runAs, the user name the page is viewed as- Returns:
- the files produced, and the reason for any format that was not
- Throws:
ReportRenderer.UnavailableException- when this server has no headless Chrome supportReportRenderer.BusyException- when the server is already running as many renders asreportRender.maxConcurrentallows and none finished withinreportRender.maxWaitSecondsException- when the path is not a report page, or the render fails outright
-