TEReport (EasyReport Designer)

Source: source/classes/tereport.prg

TEReport is the interactive visual designer for EasyReport (.vrd / .erd) report files. It wraps TEasyReport and provides a full-featured MDI editor with a menu bar, button bar, report area design surface, item insertion (text, image, graphic, barcode), undo/redo, database management, font/color configuration, and preview/print capabilities. It is the primary tool for designing report layouts visually.

Key DATA Members

DATATypeDescription
oERTEasyReportUnderlying EasyReport engine instance
cFileReportCharacterCurrent report file path
oGenVarTExStructGeneral variables container (colors, brushes, fonts, settings)
aFontsArrayArray of TFont objects (up to 20) defined for the report
aAreasArrayReport areas (bands) accessed via :oER:aAreaIni
aItemsArrayReport items per area, accessed via :oER:aItems[nArea, nItem]
oBarTButtonBarMain designer button bar
lVRDSaveLogicalWhether unsaved changes exist

Methods

MethodDescription
New( oP )Create and run the designer as an MDI child of an existing window, or as a standalone MDI window
Activate( ... )Activate the designer as a standalone MDI application with command-line file support
OpenFile( cFile, lChange, lAddDelNew )Open a .vrd or .erd report file into the designer
SaveFile()Save current report state (all areas, general settings)
SaveAs( cFile )Save report to a new file path
SaveAsNewFormat()Convert and save as new .erd format
Undo()Undo the last designer action
Redo()Redo a previously undone action
BuildMenu()Build the full designer menu structure
BarMenu()Build the designer button bar with all tools
SetGeneralSettings()Load and apply report-level general settings (measure, grid, databases)
ClientWindows()Create all MDI child windows for each report area, loading area data
DefineFonts()Load font definitions from the report file into TFont objects
OpenDatabases()Open and load database definitions from the report configuration

Example: Run EasyReport Designer from Code

#include "FiveWin.ch"

function Main()

   local oER

   oER := TEReport():New()  // Standalone designer

return nil

Example: Open a Report File in the Designer

#include "FiveWin.ch"

function Main()

   local oER

   oER := TEReport():New()
   oER:OpenFile( "myreport.vrd" )

return nil

Notes

See Also