PRIM_PDF.AutoTable (PRIM_PDF.AutoTable)
PDF generator AutoTable feature
Ancestors - Object (PRIM_OBJT)
Details
PDF generator feature to facilitate creating preformatted tables in your PDF report
Example
Creating an AutoTable.
Evtroutine Handling(#FindContacts.completed)
Define_Com Class(#PRIM_PDF) Name(#pdf)
Define_Com Class(#PRIM_PDF.AutoTable) Name(#Table) Reference(*DYNAMIC) Theme(Striped) Columncount(3)
Define_Com Class(#PRIM_PDF.AutoTableColumn) Name(#LastNameCol) Reference(*DYNAMIC)
Define_Com Class(#PRIM_PDF.AutoTableColumn) Name(#FirstNameCol) Reference(*DYNAMIC)
Define_Com Class(#PRIM_PDF.AutoTableColumn) Name(#CellPhoneCol) Reference(*DYNAMIC)
Define_Com Class(#PRIM_PDF.AutoTableRow) Name(#Row) Reference(*DYNAMIC)
#pdf.start
#pdf.setFont Font('Roboto') Style(Bold)
#pdf.setFontSize Size(16)
#pdf.text Text('My Contacts Report') Left(14) Top(10)
- Create AutoTable
#Table <= #pdf.CreateAutoTable - Table level properties
#Table.StartY := 15
#Table.Overflow := LineBreak
#Table.HeadFontName := 'Helvetica'
#Table.HeadHAlign := Left
#Table.HeadVAlign := Middle
#Table.HeadFontSize := 12
#Table.HeadFontStyle := Bold - Define table columns
#LastNameCol <= #Table.CreateColumn
#LastNameCol.HeadCaption := 'Last name'
#Table.AddColumn Column(#LastNameCol)
#FirstNameCol <= #Table.CreateColumn
#FirstNameCol.HeadCaption := 'First name'
#Table.AddColumn Column(#FirstNameCol)
#CellPhoneCol <= #Table.CreateColumn
#CellPhoneCol.HeadCaption := 'Cell Phone'
#CellPhoneCol.HeadHAlign := Center
#CellPhoneCol.HAlign := Center
#Table.AddColumn Column(#CellPhoneCol) - Add table data
Selectlist Named(#xContactsList)
#Row <= #Table.CreateRow
#Row.addCell Value(#xContactLastName)
#Row.addCell Value(#xContactFirstName)
#Row.addCell Value(#xContactMobilePhone)
#Table.AddRow Row(#Row)
Endselect - Write the AutoTable
#Table.Write - Save the PDF report
#pdf.save Filename('MyContacts.pdf')
EndroutineProperties
Name
Description
The background color for alternate table rows (Striped theme)
The text color for alternate table rows (Striped theme)
Cell padding
Cell width
The number of columns in the table
ComponentClassName is the name of the component's class. Inherited from Object (PRIM_OBJT)
ComponentMembers provides access to all the member components of this component Inherited from Object (PRIM_OBJT)
ComponentPatternName is used to qualify the class of the component. Inherited from Object (PRIM_OBJT)
Generic space allowing a value to be stored for the instance Inherited from Object (PRIM_OBJT)
ComponentType gives you access to the type information about the component Inherited from Object (PRIM_OBJT)
ComponentTypeName is the fully qualified name of the component's class. Inherited from Object (PRIM_OBJT)
The background color for table row
The font for text content in the table
The size of the font (in points) for text content in the table
The style (variant) of the font for text content in the table
The horizontal alignment of text in table cells
The background color for table column heads
The font for text content in table column heads
The size of the font (in points) for text content in column heads
The style (variant) of the font for text in table column heads
The horizontal alignment of text in table column heads
The minimum height of a cell in column heads
The color for text content in table column heads
The vertical alignment of text in table column heads
The bottom margin of a table cell
The left margin of a table cell
The right margin of a table cell
The top margin of a table cell
The minimum height of a cell in the table body
The minimum width of a cell in the table body
Name identifies the component Inherited from Object (PRIM_OBJT)
The action to take when content overflows cell width
Owner owns this component Inherited from Object (PRIM_OBJT)
Whether to split tables onto multiple pages if table height is larger than page height
The component instance to which this instance is attached. The visual container for a control or the collector of a set of child instances Inherited from Object (PRIM_OBJT)
Whether to split a row onto multiple pages if row height is larger than page height
When to show the table footer
When to show the table head
Where the table should start to be printed (a margin top value for the first page only)
Table line color
Table line width
Table width
Text color for table body content
Table theme
The vertical alignment of text in a table cell
Events
Name
Description
CreateInstance is signalled when an instance of a component is created [Inherited from PRIM_PDF.AutoTable (PRIM_PDF.AutoTable)
DestroyInstance is signalled when an instance of a component is about to be destroyed [Inherited from PRIM_PDF.AutoTable (PRIM_PDF.AutoTable)
Methods
Name
Description
Adds a column to the table Column
Adds a row to the table Row
Creates an AutoTable column Result
Creates an AutoTable row Result
Writes the AutoTable to the PDF document
See also
All Component Classes
Technical Reference