Skip to main content

Report

The workspace report: its draft text, chart theme, pages and PDF or Word export.

The draft is the same one the Desktop report form edits. In Live mode, changes appear in the open Desktop window, and export(...) writes the same document as the report page's Download buttons. In headless mode, the draft belongs to the headless workspace.

Constructor​

Signature​

Report(workspace: 'Workspace') -> None

Parameters​

NameTypeRequirementDefaultDescription
workspace'Workspace'Required—Owning workspace.

Exceptions​

  • ObjectDeletedError: If the workspace has been closed.

Example​

workspace.report.title = "Grid stability study"

Properties​

chart_theme​

Theme of report charts, or None to follow Settings > General > Report charts.

Type: ReportChartTheme | None

Access: read, write

Example​

print(workspace.report.chart_theme)

conclusions​

Optional conclusions placed after every chart and table; blank omits the section.

Type: str

Access: read, write

Example​

print(workspace.report.conclusions)

introduction​

Optional introduction placed after the index; blank omits the section.

Type: str

Access: read, write

Example​

print(workspace.report.introduction)

pages​

Every workspace page in tab order with whether the report includes it.

Type: list[ReportPageStatus]

Access: read

Example​

included = [s.page for s in workspace.report.pages if s.status == "included"]

subtitle​

Optional subtitle shown on the cover below the title.

Type: str

Access: read, write

Example​

print(workspace.report.subtitle)

title​

Report title, required to export; it also names the Desktop download.

Type: str

Access: read, write

Example​

print(workspace.report.title)

Methods​

clear​

Empty the title, subtitle, introduction and conclusions; the chart theme is kept.

Signature​

Report.clear() -> None

Example​

workspace.report.clear()

export​

Write the report as a PDF or Word document.

The document matches the Desktop report: a cover, an index, the optional introduction, every plot with a series from the included pages in tab order, interval-statistics and data-label tables, and the optional conclusions.

Signature​

Report.export(path: str | Path, *, format: ReportFormat) -> ReportExportResult

Parameters​

NameTypeRequirementDefaultDescription
pathstr | PathRequired—Output file path; relative paths resolve against the current directory.
formatReportFormatRequired—pdf or docx.

Exceptions​

  • CommandValidationError: If the format is not pdf or docx.
  • ValidationError: If the report has no title.
  • ExportError: If no included page has a plot with series.

Example​

workspace.report.export("study.pdf", format="pdf")

set​

Update several report fields at once; omitted fields keep their value.

Signature​

Report.set(*, title: str | None = None, subtitle: str | None = None, introduction: str | None = None, conclusions: str | None = None) -> None

Parameters​

NameTypeRequirementDefaultDescription
titlestr | NoneOptionalNoneReport title.
subtitlestr | NoneOptionalNoneCover subtitle.
introductionstr | NoneOptionalNoneIntroduction text; line breaks are kept.
conclusionsstr | NoneOptionalNoneConclusions text; line breaks are kept.

Exceptions​

  • CommandValidationError: If a value is not a string.

Example​

workspace.report.set(title="Grid study", introduction="Scope")

Related guides