render_report#
- ADR.render_report(*, context: dict | None = None, item_filter: str = '', embed_scene_data: bool = False, **kwargs: Any) str#
Render a report as an HTML string.
- Parameters:
- context
dict,optional Context to pass to the report template.
- item_filter
str,optional ADR filter applied to items in the report.
- embed_scene_data: bool, optional
- Whether to include full scene data for 3D visualizations in the output HTML.
This can increase the size of the output significantly, so it is disabled by default.
- **kwargs
Any Additional keyword arguments to pass to the report template. Eg: guid, name, etc. At least one keyword argument must be provided to fetch the report.
- context
- Returns:
strRendered HTML content (media type
text/html).
- Raises:
ADRExceptionIf no keyword arguments are provided or if the report rendering fails.
Examples
>>> from ansys.dynamicreporting.core.serverless import ADR >>> adr = ADR(ansys_installation=r"C:\Program Files\ANSYS Inc\v252", db_directory=r"C:\DBs\docex") >>> html_content = adr.render_report(name="Serverless Simulation Report", item_filter="A|i_tags|cont|dp=dp227;") >>> with open("report.html", "w", encoding="utf-8") as f: ... f.write(html_content)