TRLine

Source: source/classes/rline.prg

Standalone class

TRLine manages a single line of text within a TReport. It supports multiple text fragments per line, each with its own font and alignment. Lines are composed of codeblocks that are evaluated at print time to produce the final text, enabling dynamic content such as page numbers, dates, and data-driven labels.

Key DATA Members

DATATypeDescription
oReportObjectParent TReport object
aLineArrayArray of codeblocks that return text fragments
aFontArrayArray of font index codeblocks (default all 1)
aWidthArrayArray of calculated text widths per fragment
aPadArrayArray of padding alignment per fragment (RPT_LEFT, etc.)
nHeightNumericTotal line height in pixels
nWidthNumericMaximum width across all fragments
nColNumericStarting column position

Methods

MethodDescription
New( aLine, oReport, nPad )Create a new TRLine. nPad defaults to RPT_LEFT.
Stabilize( nFirstRow, nFirstCol )Calculate fragment positions and dimensions
Say( nStartRow )Render all line fragments starting at the specified row
Add( bLine, bFont, nPad )Append a new text fragment codeblock at the end
Ins( nLine, bLine, bFont, nPad )Insert a new fragment at position nLine
Del( nLinIni, nLinFin )Remove fragment(s) from nLinIni to nLinFin

Example: Line with Left and Right Fragments

#include "FiveWin.ch"
#include "report.ch"

function AddReportLines( oReport )

   local oLine

   LINE oLine OF oReport

   TEXT FRAGMENT oLine ;
        TEXT { || "Page " + Str( oReport:nPage ) } ;
        FONT { || 1 }

   TEXT FRAGMENT oLine ;
        TEXT { || Dtoc( Date() ) } ;
        FONT { || 1 } ;
        RIGHT

return nil

Notes

See Also