DynaPDF Manual - Page 94

Previous Page 93   Index   Next Page 95

Tables
Page 94 of 839
Foreground Objects
Foreground objects have a strong width and height; that means if the cell is not large enough then it
will be expanded. Text and sub tables are always foreground objects.
Text changes the width of a column, if the column width is smaller as the font size, if the flag
tfNoLineBreak is set and if the cell uses a portrait orientation, or if the cell uses a landscape
orientation and if the flag tfNoLineBreak is absent. In all other case the height of the row will be
adjusted if necessary.
Cell Alignment and Orientation
The contents in a cell can be horizontally and vertically aligned as well as rotated in 90 degrees steps.
If a cell is rotated by 90 or 270 degrees then text flows from left to right or from right to left
respectively. If the flag tfNoLineBreak is not set then the height of the cell or row must be set to a
value greater zero. If no height was set, then the font size is used as default height. This value is
usually too small and causes unpredictable results.
ColSpan, RowSpan
ColSpan or RowSpan are not directly supported but every cell can contain a sub table if necessary.
This makes it possible to create almost every combination of spanned rows or columns.
If you need these properties, then create a master table with only one column and insert new tables
with the required number of rows and columns into the cells of the master table.
Page breaks
The last parameter of DrawTable() specifies the maximum height of the table. If the maximum height
is set to a value greater zero, then the function must be executed in a while statement as follows:
pdfAppend(pdf);
tblDrawTable(tbl, 50.0f, 50.0f, 742.0f);
while (tblHaveMore(tbl))
{
pdfEndPage(pdf);
pdfAppend(pdf);
// The position and maximum height can be changed if necessary
tblDrawTable(tbl, 50.0f, 50.0f, 742.0f);
}
pdfEndPage(pdf);
It is not required to close the page directly after DrawTable() returns. You can draw additional
contents if necessary before closing the page and you can also draw additional contents before and
after drawing the remaining rows.
 

Previous topic: Background Objects

Next topic: Table and cell properties, Table color spaces