Class TrXMLReport

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TrXMLReport = class(TComponent)

Description

rXMLReport is non visual component which provides functionality for generating reports according prepared DOCX or ODT template with special TAGs

Hierarchy

  • TComponent
  • TrXMLReport

Overview

Fields

Public PrinterName: string;
Public PrintCopies: byte;
Public RaiseUnknownField: boolean;
Public NamedTables_Content: array of TTableContentRec;

Methods

Public procedure Execute(DataSets: array of TDataset);
Public procedure FormatText(const TextToFormat: string; FormatTypes: TXMLTextFormats; WholeWordOnly: boolean = false; const SeekFrom: string = ''; const SeekTo: string = '');
Public procedure ReplaceText(const OldText, NewText: string; WholeWordOnly: boolean = false; const SeekFrom: string = ''; const SeekTo: string = '');
Public function NamedTables_LoadContent(const FileName: string; const TableNamePrefix: string = ''): integer;
Public procedure NamedTables_DefineContent(const TableNameID: string; const CellXMLContent: string; const PlainText: string);
Public procedure NamedTables_ClearContent;

Properties

Public property ExtendedInfo: TStrings read FExtendedInfo;
Published property ReportFile: string read FReportFile write FReportFile;
Published property OutputFile: string read FOutputFile write FOutputFile;
Published property TemplateFormat: TTemplateFormat read FTemplateFormat write FTemplateFormat default tfAutoDetect;
Published property DefaultCalcFormat: string read FDefaultCalcFormat write FDefaultCalcFormat;
Published property DefaultNumericFormat: string read FDefaultNumericFormat write FDefaultNumericFormat;
Published property DefaultBooleanFormat: string read FDefaultBooleanFormat write FDefaultBooleanFormat;
Published property DefaultDateFormat: string read FDefaultDateFormat write FDefaultDateFormat;
Published property DefaultTimeFormat: string read FDefaultTimeFormat write FDefaultTimeFormat;
Published property JoinTouchingTables: boolean read FJoinTouchingTables write FJoinTouchingTables default false;
Published property ConvertScientificFormat: boolean read FConvertScientificFormat write FConvertScientificFormat default false;
Published property ConvertInlineFormatting: boolean read FConvertInlineFormatting write FConvertInlineFormatting default false;
Published property InlineFormatting: TStrings read FInlineFormatting write SetInlineFormatting;
Published property Variables: TStrings read FVariables write SetVariables;
Published property FieldNotFoundValue: string read FFieldNotFoundValue write FFieldNotFoundValue;
Published property MemoReplaces: TStrings read FMemoReplaces write SetMemoReplaces;
Published property ActionAfter: TActionAfter read FActionAfter write FActionAfter default aaShow;
Published property ShowMaximized: boolean read FShowMaximized write FShowMaximized default false;
Published property OnReadInfo: TNotifyEvent read FOnReadInfo write FOnReadInfo;
Published property OnUserCalc: TUserCalc read FOnUserCalc write FOnUserCalc;
Published property OnUserCalcParams: TUserCalcParams read FOnUserCalcParams write FOnUserCalcParams;
Published property OnReportProcess: TReportProcessEvent read FOnReportProcess write FOnReportProcess;
Published property OnModifyBeforeSave: TModifyContent read FModifyBeforeSave write FModifyBeforeSave;
Published property OnGetTemplateStr: TModifyContent read FOnGetTemplateStr write FOnGetTemplateStr;
Published property ShowSaveErrorDialog: boolean read FShowSaveErrorDialog write FShowSaveErrorDialog default false;
Published property ShowProgressBar: boolean read FShowProgressBar write FShowProgressBar default false;
Published property OnGetRowHeight: TGetRowHeight read FOnGetRowHeight write FOnGetRowHeight;
Published property OnGetColumnWidth: TGetColumnWidth read FOnGetColumnWidth write FOnGetColumnWidth;
Published property OnGetCellParams: TGetCellParams read FOnGetCellParams write FOnGetCellParams;
Published property RtfSupportedFormats: TRtfSupportedFormats read FRtfSupportedFormats write FRtfSupportedFormats default[];
Published property RtfCustomFormats: TStrings read FRtfCustomFormats write SetRtfCustomFormats;

Description

Fields

Public PrinterName: string;

define name of printer which will be used if Action=aaPrint

Public PrintCopies: byte;

define number of copies, used if Action=aaPrint

Public RaiseUnknownField: boolean;

defines whether exception is raised for unknown fields in template

Public NamedTables_Content: array of TTableContentRec;

defines content of all named tables in DOCX file, set by NamedTables_LoadContent or NamedTables_DefineContent, read and used during report generation by method Execute

Methods

Public procedure Execute(DataSets: array of TDataset);

execute creating of report

Public procedure FormatText(const TextToFormat: string; FormatTypes: TXMLTextFormats; WholeWordOnly: boolean = false; const SeekFrom: string = ''; const SeekTo: string = '');

can be called in OnModifyBeforeSave event, formats selected text bold, italic, underline

Public procedure ReplaceText(const OldText, NewText: string; WholeWordOnly: boolean = false; const SeekFrom: string = ''; const SeekTo: string = '');

can be called in OnModifyBeforeSave event, replace selected text, new string can contain tag to start/stop superscript or subscript \ˆ => start superscript; \_ => start subscript; \= => end superscipt or subsript

Public function NamedTables_LoadContent(const FileName: string; const TableNamePrefix: string = ''): integer;

load all named table content with TableNamePrefix to NamedTables_Content variable

Public procedure NamedTables_DefineContent(const TableNameID: string; const CellXMLContent: string; const PlainText: string);

add or modify item of NamedTables_Content variable for TableNameID

Public procedure NamedTables_ClearContent;

clear all items from NamedTables_Content variable

Properties

Public property ExtendedInfo: TStrings read FExtendedInfo;

content of INFO tag in report template, INFO tag is used for backward comunication from report to application

Published property ReportFile: string read FReportFile write FReportFile;

Define DOCX or ODT file name with report template

Published property OutputFile: string read FOutputFile write FOutputFile;

Define output file name

Published property TemplateFormat: TTemplateFormat read FTemplateFormat write FTemplateFormat default tfAutoDetect;

define format type of template (auto, DOCX, ODT)

Published property DefaultCalcFormat: string read FDefaultCalcFormat write FDefaultCalcFormat;

Define default format for calculated values

Published property DefaultNumericFormat: string read FDefaultNumericFormat write FDefaultNumericFormat;

Define default format for numeric fields

Published property DefaultBooleanFormat: string read FDefaultBooleanFormat write FDefaultBooleanFormat;

Define default format for boolean fields

Published property DefaultDateFormat: string read FDefaultDateFormat write FDefaultDateFormat;

Define default format for date fields

Published property DefaultTimeFormat: string read FDefaultTimeFormat write FDefaultTimeFormat;

Define default format for time fields

Published property JoinTouchingTables: boolean read FJoinTouchingTables write FJoinTouchingTables default false;

Define whether tables without any text between is redefined as one table (influences columns width in ODT)

Published property ConvertScientificFormat: boolean read FConvertScientificFormat write FConvertScientificFormat default false;

Define whether scientific format is converted to 123 x 10ˆ3 format using superscript, only for DOCX

Published property ConvertInlineFormatting: boolean read FConvertInlineFormatting write FConvertInlineFormatting default false;

Define whether inline format is converted to XML format accordign InlineFormatting property, only for DOCX

Published property InlineFormatting: TStrings read FInlineFormatting write SetInlineFormatting;

Define list of tag used as formatting tag in text (StartTag #9 EndTag #9 FormatTag), only for DOCX

Published property Variables: TStrings read FVariables write SetVariables;

Define list of variables and their values which can be used in report template

Published property FieldNotFoundValue: string read FFieldNotFoundValue write FFieldNotFoundValue;

Defines default value used for fields which is not found

Published property MemoReplaces: TStrings read FMemoReplaces write SetMemoReplaces;

Defines list of strings which is replaced it memo field, e.g.: <TAB>=; - replace #9 by ; ;=\line - replace ; by end of line

Published property ActionAfter: TActionAfter read FActionAfter write FActionAfter default aaShow;

Define executed action after report is created

Published property ShowMaximized: boolean read FShowMaximized write FShowMaximized default false;

Define whether DOCX file is opened in maximized window (if DOCX editor supports)

Published property OnReadInfo: TNotifyEvent read FOnReadInfo write FOnReadInfo;

define event which is called for each INFO tag

Published property OnUserCalc: TUserCalc read FOnUserCalc write FOnUserCalc;

define event which is called for getting value of undefined tags

Published property OnUserCalcParams: TUserCalcParams read FOnUserCalcParams write FOnUserCalcParams;

define event which is called for getting value of undefined tags, supports also parameters

Published property OnReportProcess: TReportProcessEvent read FOnReportProcess write FOnReportProcess;

define event which is called for each dataset records to show progress of execution

Published property OnModifyBeforeSave: TModifyContent read FModifyBeforeSave write FModifyBeforeSave;

define event which is called just before saving of result

Published property OnGetTemplateStr: TModifyContent read FOnGetTemplateStr write FOnGetTemplateStr;

define event called instead of loading of template file

Published property ShowSaveErrorDialog: boolean read FShowSaveErrorDialog write FShowSaveErrorDialog default false;

define whether re-save dialog is shown in case of saving error

Published property ShowProgressBar: boolean read FShowProgressBar write FShowProgressBar default false;

indicate whether progress bar is shown

Published property OnGetRowHeight: TGetRowHeight read FOnGetRowHeight write FOnGetRowHeight;

define event used by InserTable tag, event is called once for each row

Published property OnGetColumnWidth: TGetColumnWidth read FOnGetColumnWidth write FOnGetColumnWidth;

define event used by InserTable tag, event is called once for each column

Published property OnGetCellParams: TGetCellParams read FOnGetCellParams write FOnGetCellParams;

define event used by InserTable tag, event is called for each cell to define content and formats

Published property RtfSupportedFormats: TRtfSupportedFormats read FRtfSupportedFormats write FRtfSupportedFormats default[];

define rtf formats of rtf memo field which is converted to XML format

Published property RtfCustomFormats: TStrings read FRtfCustomFormats write SetRtfCustomFormats;

Defines list of custom rtf formats (rtfformat = xml format, e.g.: \uldb=<w:u w:val="double"/> \strike=<w:strike/>


Generated by PasDoc 0.13.0 on 2018-07-13 22:00:06