WPReporter

WPReporter is an add-on for the WPTools VCL. It is included in the 'WPTools Bundle' and can also be purchased seperately if you already bought WPTools. It includes a tool to create documents from a template and data (RTF reporting) and to add calculation to text and tables.

Syntax for TokenToTemplate conversion

The token to template conversion uses special character combinations to separate the commands from the text. Fields have to be embedded into the characters << and >>.

Example for fields:

<<name>>

The name of a field may contain space characters.

Optionally the closing '/' character can be printed:

<<name/>>

Using such fields mail merge documents can be created. Such merge documents only require fields to be filled with data. Using mail merge does not require the reporting extension so we decided to make the syntax highlighting and token to template conversion available in the basis edition.

Bands are identified by a colon (':') after the opening << characters.

Example for header bands:

<<:HEADER>>

This starts a group header or, if used outside of any group a document header text. In the latter case the following variations are possible:

HEADERF = header on first page only
HEADERO = header on odd pages
HEADERE = header on even pages
HEADER_OFF = this header is disabled.

Please note that bands are not implemented using opening and closing tokens ("i.e. <<..>>...<</...>>") so optionally the closing '/' character can be typed: <<:HEADER/>>

Example for footer bands:

<<:FOOTER>>

This starts a group footer or, if used outside of any group a document footer text. In the latter case the following variations are possible:

FOOTERF = footer on first page only
FOOTERO = footer on odd pages
FOOTERE = footer on even pages
FOOTER_OFF = this footer is disabled.

Inside header and footer bands fields, images and text is possible. A header and footer band ends where either a different header or footer band starts or a data band:

<<:DATA/>>

Bands must be the first non white space (white space= space or tab characters) in a paragraph. All text after the band token will be ignored and can be used to write comments.
Groups are identified by a double cross ('#') after the opening << characters. While bands <<:.../>> are not nested, groups can be nested and so are embedded into a tag pairs <<#...>> <<#/....>.

Unlike header and footer bands the name of the group tags are not fixed. Practically any name can be used if it does not contain spaces. However the opening token must match the closing token. For practical reasons the names should match the database which is referenced inside of the group.

Example:

<<#CUSTOMERS>>
comment: we list all customers in this group
<<Customers.Name/>>
<<Customers.Address/>>
Ordered Items:
<<#ORDERS>> comment: we list all items ordered by the current customer
<<Orders.Name/>>
<<#/ORDERS>>
<<#/CUSTOMERS>>

Note: The name of a group will be passed to the event OnReportState while creating a report. This event has to decide if a group should be processed (again) or not. It can create a sql query and calculate sub totals.

RTF Reporting The WReporter add-on makes WPTools the perfect tool to create reports as RTF files! Forget about OLE solutions - WPReporter is easier to use, quicker, more effective and doesn't rely on any external programs.

Calculation in tables The calculation feature can be used to create and update invoices right in your text. Due to the repeated table header and footer also sub totals can be also displayed. ....