Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3    Statistic  

DynaPDF.Table.Create

Creates a new table object.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DynaPDF 3.5 Yes Yes Yes Yes Yes

MBS( "DynaPDF.Table.Create"; PDF; AllocRows; NumCols; Width; DefRowHeight )

Parameters

Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf
AllocRows The number of rows to preallocate. 10
NumCols The number of columns. 5
Width The width of table. 500
DefRowHeight The default row height for a new row. 30

Result

Returns table identifier or error.

Description

Creates a new table object.
The parameter AllocRows specifies the number of rows which should be pre-allocated. The value should be large enough to avoid unnecessary memory reallocations. Note that this is just the size of the array that holds the rows which will be added later. Unused rows require 4 or 8 bytes memory (32 bit / 64 bit).
The default row height is used if the parameter Height of AddRow() or AddRows() is set to a negative value.
The widths of the columns is set to the table width divided by the number of columns (Width / NumCols).
The table must be deleted with DynaPDF.Table.Release when finish to avoid a memory leak.
DynaPDF table reference numbers are starting at 21000 and counting up for each new table.

Examples

Create table with 10 preallocated rows, 2 columns, 500 point width and 10 point default row height:

MBS("DynaPDF.Table.Create"; $pdf; 10; 2; 500; 10)

Create table and set some properties:

Set Variable [$table; Value:MBS("DynaPDF.Table.Create"; $pdf; 10; 2; 500; 10)]
Set Variable [$r; Value:MBS("DynaPDF.Table.SetBorderWidth"; $table; -1; -1; 1; 1; 1; 1)]
Set Variable [$r; Value:MBS("DynaPDF.Table.SetRGBColor"; $table; -1; -1; "BorderColor"; 255; 255; 255)]
Set Variable [$r; Value:MBS("DynaPDF.Table.SetRGBColor"; $table; -1; -1; "GridHorzColor"; 255; 255; 255)]
Set Variable [$r; Value:MBS("DynaPDF.Table.SetRGBColor"; $table; -1; -1; "GridVertColor"; 255; 255; 255)]
Set Variable [$r; Value:MBS("DynaPDF.Table.SetRGBColor"; $table; -1; -1; "TextColor"; 0; 0; 0)]
Set Variable [$r; Value:MBS("DynaPDF.Table.SetGridWidth"; $table; 10; 10)]
Set Variable [$r; Value:MBS("DynaPDF.Table.SetColWidth"; $table; 0; 200;1)]
Set Variable [$r; Value:MBS("DynaPDF.Table.SetColWidth"; $table; 1; 300;1)]
Set Variable [$r; Value:MBS("DynaPDF.Table.SetFont"; $table; -1; -1; "Helvetica"; 0; 1; "unicode")]
Set Variable [$r; Value:MBS("DynaPDF.Table.SetFontSize"; $table; -1; -1; 10)]

See also

Example Databases


DynaPDF.Table.ClearRow   -   DynaPDF.Table.DeleteCol

Feedback: Report problem or ask question.




Links
MBS Xojo tutorial videos