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
| DATA | Type | Description |
|---|---|---|
oER | TEasyReport | Underlying EasyReport engine instance |
cFileReport | Character | Current report file path |
oGenVar | TExStruct | General variables container (colors, brushes, fonts, settings) |
aFonts | Array | Array of TFont objects (up to 20) defined for the report |
aAreas | Array | Report areas (bands) accessed via :oER:aAreaIni |
aItems | Array | Report items per area, accessed via :oER:aItems[nArea, nItem] |
oBar | TButtonBar | Main designer button bar |
lVRDSave | Logical | Whether unsaved changes exist |
Methods
| Method | Description |
|---|---|
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
- TEReport is a full visual designer application, not a report execution wrapper. It hosts the
TEasyReportengine and presents an MDI-based graphical interface for designing report layouts. - Report files come in two formats: legacy
.vrd(VRD format) and new.erd(EasyReport format). The designer handles both transparently. - Each report area (band) is displayed as an MDI child window within the designer's main window, supporting drag-and-drop item placement.
- Items types include TEXT, IMAGE, GRAPHIC, and BARCODE. Each item can be positioned, sized, and styled through the properties dialog.
- Undo/redo is implemented using temporary DBF files that store entry-level and area-level changes.
- The designer includes a multi-language system supporting English, German, Italian, Spanish, Portuguese, and French.