IRIS Toolbox Reference Manual

table

Start new table

Syntax

P.table(Caption,...)

Input arguments

Options

Generic options

See help on generic options in report objects.

Description

Tables are top-level report objects and cannot be nested within other report objects, except align. Table objects can have the following children:

By default, the date row is printed as a leading row with dates formated using the option 'dateFormat='. Alternatively, you can specify this option as a cell array of two strings. In that case, the dates will be printed in two rows. The first row will have a date string displayed and centred for every year, and the first cell of the 'dateFormat=' option will be used for formatting. The second row will have a date displayed for every period (i.e. every column), and the second cell of the 'dateFormat=' option will be used for formatting.

User-defined structure of the table columns

Use the option 'colStruct=' to define your own table columns. This gives you more flexibility than when using the 'range=' option in defining the content of the table.

The option 'colStruct=' must be a 1-by-N struct, where N is the number of columns you want in the table, with the following fields:

Titles and subtitles

The input argument Caption can be either a text string, or a 1-by-2 cell array of strings. In the latter case, the first cell will be printed as a title, and the second cell will be printed as a subtitle.

To split the title or subtitle into multiple lines, use the following LaTeX commands wrapped in curly brackets: {\\} or {\\[Xpt]}, where X is the width of an extra vertical space (in points) added between the respective lines.

Example

Compare the headers of these two tables:

x = report.new();

x.table('First table', ...
    'range',qq(2010,1):qq(2012,4), ...
    'dateformat','YYYYFP');
% You can add series or subheadings here.

x.table('Second table', ...
    'range,qq(2010,1):qq(2012,4), ...
    'dateformat',{'YYYY','FP'});
% You can add series or subheadings here.

x.publish('myreport.pdf');