DynaPDF Manual - Page 101

Previous Page 100   Index   Next Page 102

Table Functions
Page 101 of 839
DrawTable
Syntax:
float tblDrawTable(
const ITBL* Table, // Table pointer
float x,
// x-coordinate
float y,
// y-coordinate
float MaxHeight)
// Maximum height or zero to avoid page breaks
The function draws the table on the specified position. The x/y-coordinates specify the top left corner
of the table. The table flows always from top to bottom.
The function must be executed in a while statement if the parameter MaxHeight is set to a value
greater zero:
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);
The function draws the header rows if any and at least one row to avoid an endless loop if the
maximum height would be smaller as the first row height.
Return values:
If the function succeeds the return value is the height of the table that was drawn so that additional
contents can be drawn below the table if necessary. If the function fails the return value is -1.
GetFirstRow
Syntax:
SI32 tblGetFirstRow(
const ITBL* Table) // Table pointer
The function returns the index of the first row that was drawn in the previous DrawTable() call.
GetNextRow() returns the next row index that will be drawn in the next DrawTable() call. If the next
row index equals the number of rows then the table was fully drawn.
Return value:
The first row index, a number greater or equal zero. This function cannot fail.
 

Previous topic: DeleteCol, DeleteRow, DeleteRows, DeleteTable

Next topic: GetFlags, GetNextHeight