Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

     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')
Endroutine

...

Name

Description

CreateInstance

CreateInstance is signalled when an instance of a component is created  Inherited from PRIM_PDF.AutoTable (PRIM_PDF.AutoTable)

DestroyInstance

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

AddColumn

Adds a column to the table

Column

AddRow

Adds a row to the table

Row

CreateColumn

Creates an AutoTable column

Result

CreateRow

Creates an AutoTable row

Result

Write

Writes the AutoTable to the PDF document

...