flow360.report.Table#

class Table#

Bases: ReportItem

Represents a table within a report, with configurable data and headers.

data: List[str | Delta | DataItem] [Required]#

A list of table data entries, which can be either strings or Delta objects.

section_title: str | None [Required]#

The title of the table section.

headers: list[str] | None = None#

List of column headers for the table, default is None.

type_name: Literal['Table'] = 'Table'#
select_indices: List[NonNegativeInt] | None = None#

Specific indices to select for the chart.

formatter: str | List[str | None] | None = None#

Formatter can be a single str (e.g. ā€œ.4gā€) or a list of str of the same length as data

get_requirements()#

Returns requirements for this item

calculate_table_data(context)#

Calculate raw table data (headers + rows) without formatting.

Returns:

(headers, rows)

headers: list of column names (strings) rows: list of rows, each row is a list of cell values

Parameters:

context (ReportContext)

Return type:

Tuple[List[str], List[List]]

to_dataframe(context)#

Convert calculated data into a Pandas DataFrame for unit-testing or external usage.

Parameters:

context (ReportContext)

Return type:

DataFrame

get_doc_item(context, settings=None)#

Returns a LaTeX doc item (Tabulary) for the table, using previously calculated data.

Parameters:
  • context (ReportContext)

  • settings (Settings | None)

Return type:

None