01 The class TableFrame

See example 12

A TableFrame is a simple frame type derived from ReportFrame. It has a lot of features to create tables in a report. It contains a sub structure (columns), but it is not a container. The TableFrame manages the columns of the table. You can add columns to the table and specify how the column will appear on the page.

The library prints a table header automatically (also on every new page), but it can be suppressed if no header is needed. The header row uses the title of the column as heading, so if you leave the title of a column empty there is no text in the header for that column.

The width of the table is the sum of the widths of the columns. There are multiple ways to define the widths of columns and it is possible that the table automatically uses the width of the parent frame. In this case the library enlarges the columns relative to their original sizes.

The lines in the table can be set individually. You can define a border around the table, horizontal lines between rows and/or vertical lines between columns. The lines use Pen objects and it possible to print all the lines with different pens. There are separate pens for the line below the header and above a total row and the other horizontal lines between rows.

The table manages the data in rows. Each row has an array of text for the columns of the table. It also has a row type which defines the text style that the library uses to print the data of the row.

  • ‘H’ for the header row
  • ‘D’ for detail rows
  • ‘S’ for subtotal rows
  • ‘T’ for total rows

There are predefined text styles for the different row types. You can change the text styles as you need them or you can create new text styles and set them in the TableFrame object.