PdfTableAddRows(tblHandle As Integer, count As Integer, height As Double) As Integer

 

Add rows of a given height to a table.

 

 

Parameters:

 

Name

Type

Description

tblHandle

Integer

The identification number (handle) of a table, obtained from the PdfTableCreate function.

count

Integer

number of rows to be added

height

Double

The specified height represents the minumum height of each row.

If the height of a foreground object is larger, then the row height will be adjusted.

Example row height: 15.0

 

The parameter height can be set to a negative value to indicate that the default row height should be used. The default row height was specified in PdfTableCreate.

 

Returns:

 

Type

Value

Description

Integer

>= 0

number of added rows

Integer

-1

failed to add rows

Integer

-2

An unknown exception occured

 

Available in:

 

WindowMain

WindowLink

YES

YES

 

Hint: You can find references to XojoScripts which make use of this function by sending the following SQL statement to the database:

Select id,GUID, ScriptName,ScriptCode from im_scripts where ScriptCode Like '%PdfTableAddRows%'

 

Example XojoScript:

 

// Create pdf file and add table with 5 rows

If PdfStart("testfile.pdf") > 0 Then

 

// Set top top-left as 0,0 coordinates

PdfSetPageCoordsTopDown

 

Dim hTbl As Integer = PdfTableCreate(1,1,200.0,9.0)

If hTbl >= 0 Then

 

// Set outer border

Call PdfTableSetBorderWidth(hTbl,-1, -1, 0.5, 0.5, 0.5, 0.5)

 

// Set inner gridlines

Call PdfTableSetGridWidth(hTbl, 0.5,0.5)

 

// Add 5 rows of 15.0 points row height

Call PdfTableAddRows(hTbl,5,15.0)

 

// Draw the table to pdf, at coordinates x=30 y=30

Call PdfTableDraw(hTbl,30.0,30.0,0.0) // 0.0 = avoid pagebreaks

 

End If // hTbl >= 0

 

// Finalize PDF

Call PdfCloseFile

 

// Open PDF in default viewer

Call Pdflaunch

 

End If // PdfStart("testfile.pdf")