ReportWorkshop ReportEditor - Lazarus Firebird version

TRichView 21.6 – decimal tabs, ReportWorkshop for Lazarus

We’ve released TRichView v21.5, ScaleRichView 12.1, ReportWorkshop 5.3.

Trial versions are available here:

Main changes in this update:

  • ReportWorkshop is ported to Lazarus
  • Decimal tabs

ReportWorkshop for Lazarus

ReportWorkshop is a set of rich-text reporting components (add-on for TRichView).

ReportWorkhop itself does not contain platform-dependent features, but it requires TRichView, and TRichView supports only Windows Lazarus platform.

Components and actions

Everything is ported: report generator component (TRVReportGenerator), universal database data provider (TRVReportDBDataProvider), all report editing actions, TRVShape component, a shape object for documents.

Lazarus has its own set of data access components, so it requires its own data providers.

This version of Report Workshop implements:

TRVReportSQLDataProvider provides access to various SQL databases (using TSQLQuery internally). Data queries: either table name, or SQL SELECT statement.


TRVReportDbfDataProvider provides access to DBF files in the specified folder (using TDbf internally). Data queries: table name, with optional filter string.

Both these data providers can be used to create master/detail and cross-tab reports, both of them are supported by the report wizard action.

Demo projects for Lazarus

New demo projects are in <TRichView Dir>\ReportWorkshop\Demos\Lazarus\ folder

There are two demo projects: for Firebird databases and for DBF tables.

Firebird folder includes a full set of demos for Firebird, mainly using TRVReportSQLDataProvider (one demo uses TRVReportDBDataProvider).
The only unavailable demo is “4 – Master-detail predefined”, which should show how to make master/detail reports without SQL statements. It is not available because TSQLQuery does not allow to specify a reference to a master dataset.
The most interesting demos are: ReportEditor (report editor with TRichViewEdit) and ScaleRichViewReportEditor (report editor with TSRichViewEdit)

Dbf folder includes only ReportEditor and ScaleRichViewEditor demos. To provide data, select a directory containing DBF files.

GDI+ support in Lazarus

While GDI+ is not used in TRichView directly, it may be used in add-on components:

  • in ScaleRichView for SRVControls
  • in ReportWorkshop for shapes and value visualizers

GDI+ provides anti-aliased lines, semitransparency, gradients.

While GDI+ is an old technology, it is still very useful, because (1) it is possible to draw content using both GDI (standard Windows functions) and GDI+ functions, and (2) GDI+ supports printing.

In Delphi, support of GDI+ is automatically enabled in Delphi XE2 and newer, and it is not available in older versions of Delphi.

In Lazarus, support of GDI+ is implemented in a separate package.

To enable it in Lazarus:

  1. Download GDI+ Library for Delphi and Lazarus and compile PGDIPlus.lpk
  2. Compile <TRichView Dir>\TRichView\Source\rvpgdipluslaz.lpk (Note: it is included in <TRichView Dir>\TRichViewLazarus_Optional.lpg project group)
  3. Include a reference to rvpgdipluslaz package in your project (Menu “Project | Project Inspector” to open Project Inspector window. Right click “Required Packages”, select menu “Add…”. Select RVPGDIPlusLaz)
  4. Include the unit RVPGDIPlusGrInLaz in “uses” of the main form unit.

Note: “GDI+ Library for Delphi and Lazarus” can be used in Delphi 2009 and newer, so it is theoretically possible to enable GDI+ support in Delphi 2009, 2010, and XE too, by including RVPGDIPlusGrInLaz unit in your project and adding it in “uses” of the main form unit. Not tested, though.


Lazarus ReportEditor demo for Firebird databases, without GDI+
Lazarus ReportEditor demo for Firebird databases, with GDI+

Decimal tabulators

In this update, a new option is added for tab alignment – rvtaDecimal.
When you work with numbers, setting a decimal tab makes numbers, such as amounts of currency, align correctly in a column. They are aligned at the position of decimal separator.

Decimal tabs are supported in Microsoft Word documents, so they can be saved and loaded in DocX and RTF files.
HTML does not support tabs.

RichViewActions (a set of components and actions for creating UI for a word processor) support decimal tabs in the ruler component and in the dialog of paragraph properties.

Decimal tabs in the paragraph properties dialog
Decimal tabs in the ReportWorkshop report

Of course, Report Workshop allows formatting numbers by defining the count of characters in a fractional part of a number, but this screenshot is a good example to show how the decimal alignment works.

Improvements in reading/writing RTF and DocX files


TRichView can process some RTF/DocX fields, but not all of them. It understands fields representing hyperlinks, external pictures, numbered sequences, page numbers and counts, and some other types of fields. If you want to process more types of fields, you can use the new event: OnReadField. In this event you can insert your own content (either one non-text item, or text (that can be multiline)) in place in RTF/DocX field.

Footnotes and endnotes

TRVStyle has 3 properties related to footnotes and endnotes:

Since this update, these properties can be written and read to DocX and RTF files.

Share this article