export_report_as_html#
- ADR.export_report_as_html(output_directory: str | Path, *, filename: str = 'index.html', dark_mode: bool = False, context: dict | None = None, item_filter: str = '', **kwargs: Any) Path#
Export a report as a standalone HTML file (plus assets).
- Parameters:
- output_directory
strorPath Directory where the report will be exported. It is created if it does not exist.
- filename
str, default: “index.html” Name of the HTML file within
output_directory.- dark_modebool, default:
False If
True, the report is rendered using a dark theme (where supported).- context
dict,optional Context to pass to the report template.
- item_filter
str,optional ADR filter applied to items in the report.
- **kwargs
Any Additional keyword arguments to pass to fetch the report template. Eg: guid, name, etc. At least one keyword argument must be provided to fetch the report.
- output_directory
- Returns:
PathPath to the generated HTML file.
- Raises:
ADRExceptionIf no keyword arguments are provided or if the static directory is not configured.
ImproperlyConfiguredErrorIf the static directory is not configured or if the output directory cannot be created.
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", media_directory=r"C:\DBs\docex\media", static_directory=r"C:\static" ) >>> adr.setup(collect_static=True) >>> output_path = adr.export_report_as_html( Path.cwd() / "htmlex", context={}, item_filter="A|i_tags|cont|dp=dp227;", name="Serverless Simulation Report", )