PRIM_PDF.AutoTable - Write Method
Writes the AutoTable to the PDF document
Member of PRIM_PDF.AutoTable (PRIM_PDF.AutoTable)
Details
Writes the AutoTable to the PDF document.
Example
Create and write 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(2)
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.AutoTableRow) Name(#Row) Reference(*DYNAMIC)
#pdf.start
* Create AutoTable
#Table <= #pdf.CreateAutoTable
* 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)
* Add table data
Selectlist Named(#xContactsList)
#Row <= #Table.CreateRow
#Row.addCell Value(#xContactLastName)
#Row.addCell Value(#xContactFirstName)
#Table.AddRow Row(#Row)
Endselect
* Write the AutoTable
#Table.Write
* Save the PDF report
#pdf.save Filename('MyContacts.pdf')
Endroutine