/Components/FastReport3/Source/frxClass.pas
http://github.com/mitshel/tech-inv · Pascal · 1738 lines · 1600 code · 110 blank · 28 comment · 0 complexity · 27f80dfb2028166247ef6fcfcd2299c3 MD5 · raw file
- {******************************************}
- { }
- { FastReport v3.0 }
- { Report classes }
- { }
- { Copyright (c) 1998-2004 }
- { by Alexander Tzyganenko, }
- { Fast Reports Inc. }
- { }
- {******************************************}
- unit frxClass;
- interface
- {$I frx.inc}
- uses
- SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs,
- IniFiles, ExtCtrls, Printers, frxVariables, frxXML,
- fs_iinterpreter, fs_ipascal, fs_icpp, fs_ibasic, fs_ijs
- {$IFDEF Delphi6}
- , Variants
- {$ENDIF};
- const
- fr01cm = 3.77953; // 96 / 25.4
- fr1cm = 37.7953;
- fr01in = 9.6;
- fr1in = 96;
- fr1CharX = 9.6;
- fr1CharY = 17;
- clTransparent = clNone;
- crHand = 50;
- crZoom = 51;
- crFormat = 52;
- type
- TfrxReport = class;
- TfrxPage = class;
- TfrxReportPage = class;
- TfrxDialogPage = class;
- TfrxCustomEngine = class;
- TfrxCustomDesigner = class;
- TfrxCustomPreview = class;
- TfrxCustomPreviewPages = class;
- TfrxComponent = class;
- TfrxReportComponent = class;
- TfrxView = class;
- TfrxStyleItem = class;
- TfrxCustomExportFilter = class;
- TfrxCustomCompressor = class;
- TfrxNotifyEvent = type String;
- TfrxCloseQueryEvent = type String;
- TfrxKeyEvent = type String;
- TfrxKeyPressEvent = type String;
- TfrxMouseEvent = type String;
- TfrxMouseMoveEvent = type String;
- TfrxPreviewClickEvent = type String;
- TfrxStretchMode = (smDontStretch, smActualHeight, smMaxHeight);
- TfrxShiftMode = (smDontShift, smAlways, smWhenOverlapped);
- TfrxDuplexMode = (dmNone, dmVertical, dmHorizontal);
- TfrxAlign = (baNone, baLeft, baRight, baCenter, baWidth, baBottom);
- TfrxFrameStyle = (fsSolid, fsDash, fsDot, fsDashDot, fsDashDotDot, fsDouble);
- TfrxFrameType = (ftLeft, ftRight, ftTop, ftBottom);
- TfrxFrameTypes = set of TfrxFrameType;
- TfrxFormatKind = (fkText, fkNumeric, fkDateTime, fkBoolean);
- TfrxHAlign = (haLeft, haRight, haCenter, haBlock);
- TfrxVAlign = (vaTop, vaBottom, vaCenter);
- TfrxRestriction = (rfDontModify, rfDontSize, rfDontMove, rfDontDelete);
- TfrxRestrictions = set of TfrxRestriction;
- TfrxShapeKind = (skRectangle, skRoundRectangle, skEllipse, skTriangle,
- skDiamond, skDiagonal1, skDiagonal2);
- TfrxPreviewButton = (pbPrint, pbLoad, pbSave, pbExport, pbZoom, pbFind,
- pbOutline, pbPageSetup, pbTools, pbEdit, pbNavigator);
- TfrxPreviewButtons = set of TfrxPreviewButton;
- TfrxZoomMode = (zmDefault, zmWholePage, zmPageWidth, zmManyPages);
- TfrxPrintPages = (ppAll, ppOdd, ppEven);
- TfrxAddPageAction = (apWriteOver, apAdd);
- TfrxRangeBegin = (rbFirst, rbCurrent);
- TfrxRangeEnd = (reLast, reCurrent, reCount);
- TfrxFieldType = (fftNumeric, fftString, fftBoolean);
- TfrxRect = record
- Left, Top, Right, Bottom: Extended;
- end;
- TfrxPoint = record
- X, Y: Extended;
- end;
- TfrxProgressEvent = procedure(Pages: TfrxCustomPreviewPages;
- Progress: Integer) of object;
- TfrxBeforePrintEvent = procedure(Sender: TfrxReportComponent) of object;
- TfrxGetValueEvent = procedure(const VarName: String; var Value: Variant) of object;
- TfrxUserFunctionEvent = function(const MethodName: String;
- var Params: Variant): Variant of object;
- TfrxManualBuildEvent = procedure(Page: TfrxPage) of object;
- TfrxClickObjectEvent = procedure(Sender: TfrxView;
- Button: TMouseButton; Shift: TShiftState; var Modified: Boolean) of object;
- TfrxMouseOverObjectEvent = procedure(Sender: TfrxView) of object;
- TfrxCheckEOFEvent = procedure(Sender: TObject; var Eof: Boolean) of object;
- TfrxRunDialogEvent = procedure(Page: TfrxDialogPage) of object;
- { Root classes }
- TfrxComponent = class(TComponent)
- private
- FObjects: TList;
- FAllObjects: TList;
- FParent: TfrxComponent;
- FLeft: Extended;
- FTop: Extended;
- FWidth: Extended;
- FHeight: Extended;
- FFont: TFont;
- FParentFont: Boolean;
- FIsDesigning: Boolean;
- FIsLoading: Boolean;
- FIsPrinting: Boolean;
- FDefaultDiff: Boolean;
- FRestrictions: TfrxRestrictions;
- FVisible: Boolean;
- function GetAbsTop: Extended;
- function GetPage: TfrxPage;
- function GetReport: TfrxReport;
- function IsFontStored: Boolean;
- function GetAllObjects: TList;
- function GetAbsLeft: Extended;
- function GetIsLoading: Boolean;
- protected
- FAliasName: String;
- FBaseName: String;
- FOriginalComponent: TfrxComponent;
- FOriginalRect: TfrxRect;
- FOriginalBand: TfrxComponent;
- procedure SetParent(AParent: TfrxComponent); virtual;
- procedure SetLeft(Value: Extended); virtual;
- procedure SetTop(Value: Extended); virtual;
- procedure SetWidth(Value: Extended); virtual;
- procedure SetHeight(Value: Extended); virtual;
- procedure SetName(const AName: TComponentName); override;
- procedure SetFont(Value: TFont); virtual;
- procedure SetParentFont(const Value: Boolean); virtual;
- procedure SetVisible(Value: Boolean); virtual;
- procedure FontChanged(Sender: TObject); virtual;
- function DiffFont(f1, f2: TFont; const Add: String): String;
- function InternalDiff(AComponent: TfrxComponent): String;
- procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
- function GetChildOwner: TComponent; override;
- public
- constructor Create(AOwner: TComponent); override;
- constructor DesignCreate(AOwner: TComponent; Flags: Word); virtual;
- destructor Destroy; override;
- procedure AlignChildren; virtual;
- procedure Assign(Source: TPersistent); override;
- procedure AssignAll(Source: TfrxComponent);
- procedure Clear; virtual;
- procedure CreateUniqueName;
- procedure LoadFromStream(Stream: TStream); virtual;
- procedure SaveToStream(Stream: TStream; SaveChildren: Boolean = True;
- SaveDefaultValues: Boolean = False); virtual;
- procedure SetBounds(ALeft, ATop, AWidth, AHeight: Extended);
- function AllDiff(AComponent: TfrxComponent): String;
- function Diff(AComponent: TfrxComponent): String; virtual;
- function FindObject(const AName: String): TfrxComponent;
- class function GetDescription: String; virtual;
- property Objects: TList read FObjects;
- property AllObjects: TList read GetAllObjects;
- property Parent: TfrxComponent read FParent write SetParent;
- property Page: TfrxPage read GetPage;
- property Report: TfrxReport read GetReport;
- property IsDesigning: Boolean read FIsDesigning write FIsDesigning;
- property IsLoading: Boolean read GetIsLoading write FIsLoading;
- property IsPrinting: Boolean read FIsPrinting write FIsPrinting;
- property BaseName: String read FBaseName;
- property DefaultDiff: Boolean read FDefaultDiff write FDefaultDiff;
- property Left: Extended read FLeft write SetLeft;
- property Top: Extended read FTop write SetTop;
- property Width: Extended read FWidth write SetWidth;
- property Height: Extended read FHeight write SetHeight;
- property AbsLeft: Extended read GetAbsLeft;
- property AbsTop: Extended read GetAbsTop;
- property Font: TFont read FFont write SetFont stored IsFontStored;
- property ParentFont: Boolean read FParentFont write SetParentFont default True;
- property Restrictions: TfrxRestrictions read FRestrictions write FRestrictions default [];
- property Visible: Boolean read FVisible write SetVisible default True;
- end;
- TfrxReportComponent = class(TfrxComponent)
- private
- FOnAfterData: TfrxNotifyEvent;
- FOnAfterPrint: TfrxNotifyEvent;
- FOnBeforePrint: TfrxNotifyEvent;
- FOnPreviewClick: TfrxPreviewClickEvent;
- public
- procedure Draw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended);
- virtual; abstract;
- procedure BeforePrint; virtual;
- procedure GetData; virtual;
- procedure AfterPrint; virtual;
- function GetComponentText: String; virtual;
- property OnAfterData: TfrxNotifyEvent read FOnAfterData write FOnAfterData;
- property OnAfterPrint: TfrxNotifyEvent read FOnAfterPrint write FOnAfterPrint;
- property OnBeforePrint: TfrxNotifyEvent read FOnBeforePrint write FOnBeforePrint;
- property OnPreviewClick: TfrxPreviewClickEvent read FOnPreviewClick write FOnPreviewClick;
- end;
- TfrxDialogComponent = class(TfrxReportComponent)
- private
- FBitmap: TBitmap;
- FComponent: TComponent;
- procedure ReadLeft(Reader: TReader);
- procedure ReadTop(Reader: TReader);
- procedure WriteLeft(Writer: TWriter);
- procedure WriteTop(Writer: TWriter);
- protected
- FImageIndex: Integer;
- procedure DefineProperties(Filer: TFiler); override;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Draw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended); override;
- property Bitmap: TBitmap read FBitmap;
- property Component: TComponent read FComponent write FComponent;
- end;
- TfrxDialogControl = class(TfrxReportComponent)
- private
- FControl: TControl;
- FOnClick: TfrxNotifyEvent;
- FOnDblClick: TfrxNotifyEvent;
- FOnEnter: TfrxNotifyEvent;
- FOnExit: TfrxNotifyEvent;
- FOnKeyDown: TfrxKeyEvent;
- FOnKeyPress: TfrxKeyPressEvent;
- FOnKeyUp: TfrxKeyEvent;
- FOnMouseDown: TfrxMouseEvent;
- FOnMouseMove: TfrxMouseMoveEvent;
- FOnMouseUp: TfrxMouseEvent;
- function GetColor: TColor;
- function GetEnabled: Boolean;
- procedure DoOnClick(Sender: TObject);
- procedure DoOnDblClick(Sender: TObject);
- procedure DoOnEnter(Sender: TObject);
- procedure DoOnExit(Sender: TObject);
- procedure DoOnKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
- procedure DoOnKeyPress(Sender: TObject; var Key: Char);
- procedure DoOnKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
- procedure DoOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- procedure DoOnMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
- procedure DoOnMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- procedure SetColor(const Value: TColor);
- procedure SetEnabled(const Value: Boolean);
- function GetCaption: String;
- procedure SetCaption(const Value: String);
- protected
- procedure SetLeft(Value: Extended); override;
- procedure SetTop(Value: Extended); override;
- procedure SetWidth(Value: Extended); override;
- procedure SetHeight(Value: Extended); override;
- procedure SetParentFont(const Value: Boolean); override;
- procedure SetVisible(Value: Boolean); override;
- procedure SetParent(AParent: TfrxComponent); override;
- procedure FontChanged(Sender: TObject); override;
- procedure InitControl(AControl: TControl);
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Draw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended); override;
- property Caption: String read GetCaption write SetCaption;
- property Color: TColor read GetColor write SetColor default clBtnFace;
- property Control: TControl read FControl write FControl;
- property OnClick: TfrxNotifyEvent read FOnClick write FOnClick;
- property OnDblClick: TfrxNotifyEvent read FOnDblClick write FOnDblClick;
- property OnEnter: TfrxNotifyEvent read FOnEnter write FOnEnter;
- property OnExit: TfrxNotifyEvent read FOnExit write FOnExit;
- property OnKeyDown: TfrxKeyEvent read FOnKeyDown write FOnKeyDown;
- property OnKeyPress: TfrxKeyPressEvent read FOnKeyPress write FOnKeyPress;
- property OnKeyUp: TfrxKeyEvent read FOnKeyUp write FOnKeyUp;
- property OnMouseDown: TfrxMouseEvent read FOnMouseDown write FOnMouseDown;
- property OnMouseMove: TfrxMouseMoveEvent read FOnMouseMove write FOnMouseMove;
- property OnMouseUp: TfrxMouseEvent read FOnMouseUp write FOnMouseUp;
- published
- property Left;
- property Top;
- property Width;
- property Height;
- property Font;
- property ParentFont;
- property Enabled: Boolean read GetEnabled write SetEnabled default True;
- property Visible;
- end;
- TfrxDataSet = class(TfrxDialogComponent)
- private
- FCloseDataSource: Boolean;
- FEnabled: Boolean;
- FOpenDataSource: Boolean;
- FRangeBegin: TfrxRangeBegin;
- FRangeEnd: TfrxRangeEnd;
- FRangeEndCount: Integer;
- FReportRef: TfrxReport;
- FUserName: String;
- FOnCheckEOF: TfrxCheckEOFEvent;
- FOnFirst: TNotifyEvent;
- FOnNext: TNotifyEvent;
- FOnPrior: TNotifyEvent;
- FOnOpen: TNotifyEvent;
- FOnClose: TNotifyEvent;
- function NameExists(const Name: String): Boolean;
- protected
- FInitialized: Boolean;
- FRecNo: Integer;
- function GetDisplayText(Index: String): String; virtual;
- function GetDisplayWidth(Index: String): Integer; virtual;
- function GetFieldType(Index: String): TfrxFieldType; virtual;
- function GetValue(Index: String): Variant; virtual;
- procedure SetName(const NewName: TComponentName); override;
- procedure SetUserName(const Value: String); virtual;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- { Navigation methods }
- procedure Initialize; virtual;
- procedure Initialize1; virtual;
- procedure Finalize; virtual;
- procedure Open; virtual;
- procedure Close; virtual;
- procedure First; virtual;
- procedure Next; virtual;
- procedure Prior; virtual;
- function Eof: Boolean; virtual;
- { Data access }
- function FieldsCount: Integer; virtual;
- function HasField(const fName: String): Boolean;
- function IsBlobField(const fName: String): Boolean; virtual;
- procedure AssignBlobTo(const fName: String; Obj: TObject); virtual;
- procedure GetFieldList(List: TStrings); virtual;
- property DisplayText[Index: String]: String read GetDisplayText;
- property DisplayWidth[Index: String]: Integer read GetDisplayWidth;
- property FieldType[Index: String]: TfrxFieldType read GetFieldType;
- property Value[Index: String]: Variant read GetValue;
- property CloseDataSource: Boolean read FCloseDataSource write FCloseDataSource default False;
- property OpenDataSource: Boolean read FOpenDataSource write FOpenDataSource default True;
- property RecNo: Integer read FRecNo;
- property ReportRef: TfrxReport read FReportRef write FReportRef;
- property OnClose: TNotifyEvent read FOnClose write FOnClose;
- property OnOpen: TNotifyEvent read FOnOpen write FOnOpen;
- published
- property Enabled: Boolean read FEnabled write FEnabled default True;
- property RangeBegin: TfrxRangeBegin read FRangeBegin write FRangeBegin default rbFirst;
- property RangeEnd: TfrxRangeEnd read FRangeEnd write FRangeEnd default reLast;
- property RangeEndCount: Integer read FRangeEndCount write FRangeEndCount default 0;
- property UserName: String read FUserName write SetUserName;
- property OnCheckEOF: TfrxCheckEOFEvent read FOnCheckEOF write FOnCheckEOF;
- property OnFirst: TNotifyEvent read FOnFirst write FOnFirst;
- property OnNext: TNotifyEvent read FOnNext write FOnNext;
- property OnPrior: TNotifyEvent read FOnPrior write FOnPrior;
- end;
- TfrxUserDataSet = class(TfrxDataset);
- TfrxCustomDBDataSet = class(TfrxDataSet)
- private
- FAliases: TStrings;
- FFields: TStringList;
- procedure SetFieldAliases(const Value: TStrings);
- protected
- property Fields: TStringList read FFields;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- function ConvertAlias(const fName: String): String;
- function GetAlias(const fName: String): String;
- function FieldsCount: Integer; override;
- published
- property CloseDataSource;
- property FieldAliases: TStrings read FAliases write SetFieldAliases;
- property OpenDataSource;
- property OnClose;
- property OnOpen;
- end;
- TfrxDBComponents = class(TComponent)
- public
- function GetDescription: String; virtual;
- end;
- TfrxComponentClass = class of TfrxComponent;
- { Report Objects }
- TfrxFrame = class(TPersistent)
- private
- FColor: TColor;
- FDropShadow: Boolean;
- FShadowWidth: Extended;
- FShadowColor: TColor;
- FStyle: TfrxFrameStyle;
- FTyp: TfrxFrameTypes;
- FWidth: Extended;
- function IsShadowWidthStored: Boolean;
- function IsTypStored: Boolean;
- function IsWidthStored: Boolean;
- public
- constructor Create;
- procedure Assign(Source: TPersistent); override;
- function Diff(AFrame: TfrxFrame): String;
- published
- property Color: TColor read FColor write FColor default clBlack;
- property DropShadow: Boolean read FDropShadow write FDropShadow default False;
- property ShadowColor: TColor read FShadowColor write FShadowColor default clBlack;
- property ShadowWidth: Extended read FShadowWidth write FShadowWidth stored IsShadowWidthStored;
- property Style: TfrxFrameStyle read FStyle write FStyle default fsSolid;
- property Typ: TfrxFrameTypes read FTyp write FTyp stored IsTypStored;
- property Width: Extended read FWidth write FWidth stored IsWidthStored;
- end;
- TfrxView = class(TfrxReportComponent)
- private
- FAlign: TfrxAlign;
- FBrushStyle: TBrushStyle;
- FColor: TColor;
- FCursor: TCursor;
- FDataField: String;
- FDataSet: TfrxDataSet;
- FDataSetName: String;
- FFrame: TfrxFrame;
- FPrintable: Boolean;
- FShiftMode: TfrxShiftMode;
- FTagStr: String;
- FTempTag: String;
- FTempURL: String;
- FURL: String;
- procedure SetFrame(const Value: TfrxFrame);
- procedure SetDataSet(const Value: TfrxDataSet);
- procedure SetDataSetName(const Value: String);
- function GetDataSetName: String;
- protected
- FX, FY, FX1, FY1, FDX, FDY, FFrameWidth: Integer;
- FScaleX, FScaleY, FOffsetX, FOffsetY: Extended;
- FCanvas: TCanvas;
- procedure BeginDraw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended); virtual;
- procedure DrawBackground; virtual;
- procedure DrawFrame; virtual;
- procedure DrawLine(x, y, x1, y1, w: Integer);
- procedure Notification(AComponent: TComponent; Operation: TOperation); override;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- function Diff(AComponent: TfrxComponent): String; override;
- function IsDataField: Boolean;
- procedure Draw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended); override;
- procedure BeforePrint; override;
- procedure GetData; override;
- procedure AfterPrint; override;
- property BrushStyle: TBrushStyle read FBrushStyle write FBrushStyle default bsSolid;
- property Color: TColor read FColor write FColor default clTransparent;
- property DataField: String read FDataField write FDataField;
- property DataSet: TfrxDataSet read FDataSet write SetDataSet;
- property DataSetName: String read GetDataSetName write SetDataSetName;
- property Frame: TfrxFrame read FFrame write SetFrame;
- published
- property Align: TfrxAlign read FAlign write FAlign default baNone;
- property Cursor: TCursor read FCursor write FCursor default crDefault;
- property Printable: Boolean read FPrintable write FPrintable default True;
- property ShiftMode: TfrxShiftMode read FShiftMode write FShiftMode default smAlways;
- property TagStr: String read FTagStr write FTagStr;
- property URL: String read FURL write FURL;
- property Left;
- property Top;
- property Width;
- property Height;
- property Restrictions;
- property Visible;
- property OnAfterData;
- property OnAfterPrint;
- property OnBeforePrint;
- property OnPreviewClick;
- end;
- TfrxStretcheable = class(TfrxView)
- private
- FStretchMode: TfrxStretchMode;
- public
- FSaveHeight: Extended;
- constructor Create(AOwner: TComponent); override;
- function CalcHeight: Extended; virtual;
- function DrawPart: Extended; virtual;
- procedure InitPart; virtual;
- published
- property StretchMode: TfrxStretchMode read FStretchMode write FStretchMode
- default smDontStretch;
- end;
- TfrxHighlight = class(TPersistent)
- private
- FActive: Boolean;
- FColor: TColor;
- FCondition: String;
- FFont: TFont;
- procedure SetFont(const Value: TFont);
- public
- constructor Create;
- destructor Destroy; override;
- procedure Assign(Source: TPersistent); override;
- published
- property Active: Boolean read FActive write FActive default False;
- property Font: TFont read FFont write SetFont;
- property Color: TColor read FColor write FColor default clTransparent;
- property Condition: String read FCondition write FCondition;
- end;
- TfrxFormat = class(TPersistent)
- private
- FDecimalSeparator: String;
- FFormatStr: String;
- FKind: TfrxFormatKind;
- public
- procedure Assign(Source: TPersistent); override;
- published
- property DecimalSeparator: String read FDecimalSeparator write FDecimalSeparator;
- property FormatStr: String read FFormatStr write FFormatStr;
- property Kind: TfrxFormatKind read FKind write FKind default fkText;
- end;
- TfrxCustomMemoView = class(TfrxStretcheable)
- private
- FAllowExpressions: Boolean;
- FAllowHTMLTags: Boolean;
- FAutoWidth: Boolean;
- FCharSpacing: Extended;
- FDisplayFormat: TfrxFormat;
- FExpressionDelimiters: String;
- FFlowTo: TfrxCustomMemoView;
- FGapX: Extended;
- FGapY: Extended;
- FHAlign: TfrxHAlign;
- FHideZeros: Boolean;
- FHighlight: TfrxHighlight;
- FLineSpacing: Extended;
- FMemo: TStrings;
- FParagraphGap: Extended;
- FRotation: Integer;
- FRTLReading: Boolean;
- FStyle: String;
- FSuppressRepeated: Boolean;
- FTempMemo, FPartMemo: String;
- FUnderlines: Boolean;
- FVAlign: TfrxVAlign;
- FWordBreak: Boolean;
- FWordWrap: Boolean;
- procedure SetMemo(const Value: TStrings);
- procedure SetRotation(Value: Integer);
- procedure SetText(const Value: String);
- function AdjustCalcHeight: Extended;
- function AdjustCalcWidth: Extended;
- function GetText: String;
- function IsExprDelimitersStored: Boolean;
- function IsLineSpacingStored: Boolean;
- function IsGapXStored: Boolean;
- function IsGapYStored: Boolean;
- function IsHighlightStored: Boolean;
- function IsParagraphGapStored: Boolean;
- procedure SetHighlight(const Value: TfrxHighlight);
- procedure SetDisplayFormat(const Value: TfrxFormat);
- procedure SetStyle(const Value: String);
- function IsCharSpacingStored: Boolean;
- protected
- FLastValue: Variant;
- FTotalPages: Integer;
- FTextRect: TRect;
- FValue: Variant;
- function CalcAndFormat(const Expr: String): String;
- procedure BeginDraw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended); override;
- procedure SetDrawParams(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended);
- procedure Notification(AComponent: TComponent; Operation: TOperation); override;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- class function GetDescription: String; override;
- function Diff(AComponent: TfrxComponent): String; override;
- function CalcHeight: Extended; override;
- function CalcWidth: Extended; virtual;
- function DrawPart: Extended; override;
- function GetComponentText: String; override;
- function FormatData(const Value: Variant; AFormat: TfrxFormat = nil): String;
- function WrapText: String;
- procedure Draw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended); override;
- procedure BeforePrint; override;
- procedure GetData; override;
- procedure AfterPrint; override;
- procedure InitPart; override;
- procedure ApplyStyle(Style: TfrxStyleItem);
- procedure ExtractTotalPages;
- property Text: String read GetText write SetText;
- property AllowExpressions: Boolean read FAllowExpressions write FAllowExpressions default True;
- property AllowHTMLTags: Boolean read FAllowHTMLTags write FAllowHTMLTags default False;
- property AutoWidth: Boolean read FAutoWidth write FAutoWidth default False;
- property CharSpacing: Extended read FCharSpacing write FCharSpacing stored IsCharSpacingStored;
- property DisplayFormat: TfrxFormat read FDisplayFormat write SetDisplayFormat;
- property ExpressionDelimiters: String read FExpressionDelimiters
- write FExpressionDelimiters stored IsExprDelimitersStored;
- property FlowTo: TfrxCustomMemoView read FFlowTo write FFlowTo;
- property GapX: Extended read FGapX write FGapX stored IsGapXStored;
- property GapY: Extended read FGapY write FGapY stored IsGapYStored;
- property HAlign: TfrxHAlign read FHAlign write FHAlign default haLeft;
- property HideZeros: Boolean read FHideZeros write FHideZeros default False;
- property Highlight: TfrxHighlight read FHighlight write SetHighlight
- stored IsHighlightStored;
- property LineSpacing: Extended read FLineSpacing write FLineSpacing stored IsLineSpacingStored;
- property Memo: TStrings read FMemo write SetMemo;
- property ParagraphGap: Extended read FParagraphGap write FParagraphGap stored IsParagraphGapStored;
- property Rotation: Integer read FRotation write SetRotation default 0;
- property RTLReading: Boolean read FRTLReading write FRTLReading default False;
- property Style: String read FStyle write SetStyle;
- property SuppressRepeated: Boolean read FSuppressRepeated write FSuppressRepeated default False;
- property Underlines: Boolean read FUnderlines write FUnderlines default False;
- property WordBreak: Boolean read FWordBreak write FWordBreak default False;
- property WordWrap: Boolean read FWordWrap write FWordWrap default True;
- property VAlign: TfrxVAlign read FVAlign write FVAlign default vaTop;
- end;
- TfrxMemoView = class(TfrxCustomMemoView)
- published
- property AutoWidth;
- property AllowExpressions;
- property AllowHTMLTags;
- property BrushStyle;
- property CharSpacing;
- property Color;
- property DataField;
- property DataSet;
- property DataSetName;
- property DisplayFormat;
- property ExpressionDelimiters;
- property FlowTo;
- property Font;
- property Frame;
- property GapX;
- property GapY;
- property HAlign;
- property HideZeros;
- property Highlight;
- property LineSpacing;
- property Memo;
- property ParagraphGap;
- property ParentFont;
- property Rotation;
- property RTLReading;
- property Style;
- property SuppressRepeated;
- property Underlines;
- property WordBreak;
- property WordWrap;
- property VAlign;
- end;
- TfrxSysMemoView = class(TfrxCustomMemoView)
- public
- class function GetDescription: String; override;
- published
- property AutoWidth;
- property BrushStyle;
- property CharSpacing;
- property Color;
- property DisplayFormat;
- property Font;
- property Frame;
- property GapX;
- property GapY;
- property HAlign;
- property HideZeros;
- property Highlight;
- property Memo;
- property ParentFont;
- property Rotation;
- property RTLReading;
- property Style;
- property SuppressRepeated;
- property VAlign;
- end;
- TfrxCustomLineView = class(TfrxStretcheable)
- private
- FDiagonal: Boolean;
- procedure DrawDiagonalLine;
- public
- constructor Create(AOwner: TComponent); override;
- constructor DesignCreate(AOwner: TComponent; Flags: Word); override;
- procedure Draw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended); override;
- property Diagonal: Boolean read FDiagonal write FDiagonal default False;
- end;
- TfrxLineView = class(TfrxCustomLineView)
- public
- class function GetDescription: String; override;
- published
- property Frame;
- property Diagonal;
- end;
- TfrxPictureView = class(TfrxView)
- private
- FAutoSize: Boolean;
- FCenter: Boolean;
- FKeepAspectRatio: Boolean;
- FPicture: TPicture;
- FPictureChanged: Boolean;
- FStretched: Boolean;
- procedure SetPicture(const Value: TPicture);
- procedure PictureChanged(Sender: TObject);
- procedure SetAutoSize(const Value: Boolean);
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- function Diff(AComponent: TfrxComponent): String; override;
- procedure Draw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended); override;
- procedure GetData; override;
- class function GetDescription: String; override;
- published
- property AutoSize: Boolean read FAutoSize write SetAutoSize default False;
- property Center: Boolean read FCenter write FCenter default False;
- property DataField;
- property DataSet;
- property DataSetName;
- property Frame;
- property KeepAspectRatio: Boolean read FKeepAspectRatio write FKeepAspectRatio default True;
- property Picture: TPicture read FPicture write SetPicture;// stored IsPictureStored;
- property Stretched: Boolean read FStretched write FStretched default True;
- end;
- TfrxShapeView = class(TfrxView)
- private
- FShape: TfrxShapeKind;
- public
- constructor Create(AOwner: TComponent); override;
- constructor DesignCreate(AOwner: TComponent; Flags: Word); override;
- function Diff(AComponent: TfrxComponent): String; override;
- procedure Draw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended); override;
- class function GetDescription: String; override;
- published
- property BrushStyle;
- property Color;
- property Frame;
- property Shape: TfrxShapeKind read FShape write FShape default skRectangle;
- end;
- TfrxSubreport = class(TfrxView)
- private
- FPage: TfrxReportPage;
- FPrintOnParent: Boolean;
- procedure SetPage(const Value: TfrxReportPage);
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Draw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended); override;
- class function GetDescription: String; override;
- published
- property Page: TfrxReportPage read FPage write SetPage;
- property PrintOnParent: Boolean read FPrintOnParent write FPrintOnParent
- default False;
- end;
- { Bands }
- TfrxChild = class;
- TfrxBand = class(TfrxReportComponent)
- private
- FAllowSplit: Boolean;
- FChild: TfrxChild;
- FKeepChild: Boolean;
- FOnAfterCalcHeight: TfrxNotifyEvent;
- FOutlineText: String;
- FOverflow: Boolean;
- FStartNewPage: Boolean;
- FStretched: Boolean;
- FPrintChildIfInvisible: Boolean;
- FVertical: Boolean;
- function GetBandName: String;
- protected
- procedure Notification(AComponent: TComponent; Operation: TOperation); override;
- procedure SetLeft(Value: Extended); override;
- procedure SetTop(Value: Extended); override;
- procedure SetHeight(Value: Extended); override;
- public
- FSubBands: TList; { list of subbands }
- FHeader, FFooter, FGroup: TfrxBand; { h./f./g. bands }
- FLineN: Integer; { used for Line# }
- FLineThrough: Integer; { used for LineThrough# }
- FOriginalObjectsCount: Integer; { used for TfrxSubReport.PrintOnParent }
- FHasVBands: Boolean; { whether the band should show vbands }
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- function BandNumber: Integer;
- procedure Draw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended); override;
- class function GetDescription: String; override;
- property AllowSplit: Boolean read FAllowSplit write FAllowSplit default False;
- property BandName: String read GetBandName;
- property Child: TfrxChild read FChild write FChild;
- property KeepChild: Boolean read FKeepChild write FKeepChild default False;
- property Overflow: Boolean read FOverflow write FOverflow;
- property PrintChildIfInvisible: Boolean read FPrintChildIfInvisible
- write FPrintChildIfInvisible default False;
- property StartNewPage: Boolean read FStartNewPage write FStartNewPage default False;
- property Stretched: Boolean read FStretched write FStretched default False;
- published
- property Font;
- property Height;
- property Left;
- property OutlineText: String read FOutlineText write FOutlineText;
- property ParentFont;
- property Restrictions;
- property Top;
- property Vertical: Boolean read FVertical write FVertical default False;
- property Visible;
- property Width;
- property OnAfterCalcHeight: TfrxNotifyEvent read FOnAfterCalcHeight
- write FOnAfterCalcHeight;
- property OnAfterPrint;
- property OnBeforePrint;
- end;
- TfrxBandClass = class of TfrxBand;
- TfrxDataBand = class(TfrxBand)
- private
- FColumnGap: Extended;
- FColumnWidth: Extended;
- FColumns: Integer;
- FCurColumn: Integer;
- FDataSet: TfrxDataSet;
- FDataSetName: String;
- FFooterAfterEach: Boolean;
- FKeepFooter: Boolean;
- FKeepTogether: Boolean;
- FPrintIfDetailEmpty: Boolean;
- FRowCount: Integer;
- FOnMasterDetail: TfrxNotifyEvent;
- FVirtualDataSet: TfrxUserDataSet;
- procedure SetCurColumn(Value: Integer);
- procedure SetRowCount(const Value: Integer);
- procedure SetDataSet(const Value: TfrxDataSet);
- procedure SetDataSetName(const Value: String);
- function GetDataSetName: String;
- protected
- procedure Notification(AComponent: TComponent; Operation: TOperation); override;
- public
- FMaxY: Extended; { used for columns }
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- class function GetDescription: String; override;
- property CurColumn: Integer read FCurColumn write SetCurColumn;
- property VirtualDataSet: TfrxUserDataSet read FVirtualDataSet;
- published
- property AllowSplit;
- property Child;
- property Columns: Integer read FColumns write FColumns default 0;
- property ColumnWidth: Extended read FColumnWidth write FColumnWidth;
- property ColumnGap: Extended read FColumnGap write FColumnGap;
- property DataSet: TfrxDataSet read FDataSet write SetDataSet;
- property DataSetName: String read GetDataSetName write SetDataSetName;
- property FooterAfterEach: Boolean read FFooterAfterEach write FFooterAfterEach default False;
- property KeepChild;
- property KeepFooter: Boolean read FKeepFooter write FKeepFooter default False;
- property KeepTogether: Boolean read FKeepTogether write FKeepTogether default False;
- property PrintChildIfInvisible;
- property PrintIfDetailEmpty: Boolean read FPrintIfDetailEmpty
- write FPrintIfDetailEmpty default False;
- property RowCount: Integer read FRowCount write SetRowCount;
- property StartNewPage;
- property Stretched;
- property OnMasterDetail: TfrxNotifyEvent read FOnMasterDetail write FOnMasterDetail;
- end;
- TfrxHeader = class(TfrxBand)
- private
- FReprintOnNewPage: Boolean;
- published
- property AllowSplit;
- property Child;
- property KeepChild;
- property PrintChildIfInvisible;
- property ReprintOnNewPage: Boolean read FReprintOnNewPage write FReprintOnNewPage default False;
- property StartNewPage;
- property Stretched;
- end;
- TfrxFooter = class(TfrxBand)
- private
- public
- published
- property AllowSplit;
- property Child;
- property KeepChild;
- property PrintChildIfInvisible;
- property Stretched;
- end;
- TfrxMasterData = class(TfrxDataBand)
- private
- public
- published
- end;
- TfrxDetailData = class(TfrxDataBand)
- private
- public
- published
- end;
- TfrxSubdetailData = class(TfrxDataBand)
- private
- public
- published
- end;
- TfrxDataBand4 = class(TfrxDataBand)
- private
- public
- published
- end;
- TfrxDataBand5 = class(TfrxDataBand)
- private
- public
- published
- end;
- TfrxDataBand6 = class(TfrxDataBand)
- private
- public
- published
- end;
- TfrxPageHeader = class(TfrxBand)
- private
- FPrintOnFirstPage: Boolean;
- public
- constructor Create(AOwner: TComponent); override;
- published
- property PrintOnFirstPage: Boolean read FPrintOnFirstPage write FPrintOnFirstPage default True;
- property Stretched;
- end;
- TfrxPageFooter = class(TfrxBand)
- private
- FPrintOnFirstPage: Boolean;
- FPrintOnLastPage: Boolean;
- public
- constructor Create(AOwner: TComponent); override;
- published
- property PrintOnFirstPage: Boolean read FPrintOnFirstPage write FPrintOnFirstPage default True;
- property PrintOnLastPage: Boolean read FPrintOnLastPage write FPrintOnLastPage default True;
- end;
- TfrxColumnHeader = class(TfrxBand)
- private
- public
- published
- property Stretched;
- end;
- TfrxColumnFooter = class(TfrxBand)
- private
- public
- published
- end;
- TfrxGroupHeader = class(TfrxBand)
- private
- FCondition: String;
- FKeepTogether: Boolean;
- FReprintOnNewPage: Boolean;
- public
- FLastValue: Variant;
- published
- property AllowSplit;
- property Child;
- property Condition: String read FCondition write FCondition;
- property KeepChild;
- property KeepTogether: Boolean read FKeepTogether write FKeepTogether default False;
- property ReprintOnNewPage: Boolean read FReprintOnNewPage write FReprintOnNewPage default False;
- property PrintChildIfInvisible;
- property StartNewPage;
- property Stretched;
- end;
- TfrxGroupFooter = class(TfrxBand)
- private
- public
- published
- property AllowSplit;
- property Child;
- property KeepChild;
- property PrintChildIfInvisible;
- property Stretched;
- end;
- TfrxReportTitle = class(TfrxBand)
- private
- public
- published
- property Child;
- property KeepChild;
- property PrintChildIfInvisible;
- property StartNewPage;
- property Stretched;
- end;
- TfrxReportSummary = class(TfrxBand)
- private
- public
- published
- property AllowSplit;
- property Child;
- property KeepChild;
- property PrintChildIfInvisible;
- property StartNewPage;
- property Stretched;
- end;
- TfrxChild = class(TfrxBand)
- private
- public
- published
- property AllowSplit;
- property Child;
- property KeepChild;
- property PrintChildIfInvisible;
- property StartNewPage;
- property Stretched;
- end;
- TfrxOverlay = class(TfrxBand)
- private
- public
- published
- end;
- TfrxNullBand = class(TfrxBand);
- { Pages }
- TfrxPage = class(TfrxComponent)
- private
- protected
- public
- published
- property Font;
- property Visible;
- end;
- TfrxReportPage = class(TfrxPage)
- private
- FBackPicture: TfrxPictureView;
- FBin: Integer;
- FBinOtherPages: Integer;
- FBottomMargin: Extended;
- FColumns: Integer;
- FColumnWidth: Extended;
- FColumnPositions: TStrings;
- FDataSet: TfrxDataSet;
- FDuplex: TfrxDuplexMode;
- FHGuides: TStrings;
- FLargeDesignHeight: Boolean;
- FLeftMargin: Extended;
- FMirrorMargins: Boolean;
- FOrientation: TPrinterOrientation;
- FOutlineText: String;
- FPrintIfEmpty: Boolean;
- FPrintOnPreviousPage: Boolean;
- FRightMargin: Extended;
- FSubReport: TfrxSubReport;
- FTitleBeforeHeader: Boolean;
- FTopMargin: Extended;
- FVGuides: TStrings;
- FOnAfterPrint: TfrxNotifyEvent;
- FOnBeforePrint: TfrxNotifyEvent;
- FOnManualBuild: TfrxNotifyEvent;
- FDataSetName: String;
- procedure SetColumns(const Value: Integer);
- procedure SetOrientation(Value: TPrinterOrientation);
- procedure SetHGuides(const Value: TStrings);
- procedure SetVGuides(const Value: TStrings);
- procedure SetColumnPositions(const Value: TStrings);
- procedure SetFrame(const Value: TfrxFrame);
- function GetFrame: TfrxFrame;
- function GetColor: TColor;
- procedure SetColor(const Value: TColor);
- function GetBackPicture: TPicture;
- procedure SetBackPicture(const Value: TPicture);
- procedure SetDataSet(const Value: TfrxDataSet);
- procedure SetDataSetName(const Value: String);
- function GetDataSetName: String;
- protected
- FPaperHeight: Extended;
- FPaperSize: Integer;
- FPaperWidth: Extended;
- procedure Notification(AComponent: TComponent; Operation: TOperation); override;
- procedure SetPaperHeight(const Value: Extended); virtual;
- procedure SetPaperWidth(const Value: Extended); virtual;
- procedure SetPaperSize(const Value: Integer); virtual;
- procedure UpdateDimensions;
- public
- FSubBands: TList; { list of master bands }
- FVSubBands: TList; { list of vertical master bands }
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- class function GetDescription: String; override;
- function FindBand(Band: TfrxBandClass): TfrxBand;
- function IsSubReport: Boolean;
- procedure AlignChildren; override;
- procedure ClearGuides;
- procedure Draw(Canvas: TCanvas; ScaleX, ScaleY, OffsetX, OffsetY: Extended);
- procedure SetDefaults; virtual;
- property SubReport: TfrxSubReport read FSubReport;
- published
- { paper }
- property Orientation: TPrinterOrientation read FOrientation
- write SetOrientation default poPortrait;
- property PaperWidth: Extended read FPaperWidth write SetPaperWidth;
- property PaperHeight: Extended read FPaperHeight write SetPaperHeight;
- property PaperSize: Integer read FPaperSize write SetPaperSize;
- { margins }
- property LeftMargin: Extended read FLeftMargin write FLeftMargin;
- property RightMargin: Extended read FRightMargin write FRightMargin;
- property TopMargin: Extended read FTopMargin write FTopMargin;
- property BottomMargin: Extended read FBottomMargin write FBottomMargin;
- property MirrorMargins: Boolean read FMirrorMargins write FMirrorMargins
- default False;
- { columns }
- property Columns: Integer read FColumns write SetColumns default 0;
- property ColumnWidth: Extended read FColumnWidth write FColumnWidth;
- property ColumnPositions: TStrings read FColumnPositions write SetColumnPositions;
- { bins }
- property Bin: Integer read FBin write FBin default DMBIN_AUTO;
- property BinOtherPages: Integer read FBinOtherPages write FBinOtherPages
- default DMBIN_AUTO;
- { other }
- property BackPicture: TPicture read GetBackPicture write SetBackPicture;
- property Color: TColor read GetColor write SetColor default clTransparent;
- property DataSet: TfrxDataSet read FDataSet write SetDataSet;
- property DataSetName: String read GetDataSetName write SetDataSetName;
- property Duplex: TfrxDuplexMode read FDuplex write FDuplex default dmNone;
- property Frame: TfrxFrame read GetFrame write SetFrame;
- property LargeDesignHeight: Boolean read FLargeDesignHeight
- write FLargeDesignHeight default False;
- property OutlineText: String read FOutlineText write FOutlineText;
- property PrintIfEmpty: Boolean read FPrintIfEmpty write FPrintIfEmpty default True;
- property PrintOnPreviousPage: Boolean read FPrintOnPreviousPage
- write FPrintOnPreviousPage default False;
- property TitleBeforeHeader: Boolean read FTitleBeforeHeader
- write FTitleBeforeHeader default True;
- property HGuides: TStrings read FHGuides write SetHGuides;
- property VGuides: TStrings read FVGuides write SetVGuides;
- property OnAfterPrint: TfrxNotifyEvent read FOnAfterPrint write FOnAfterPrint;
- property OnBeforePrint: TfrxNotifyEvent read FOnBeforePrint write FOnBeforePrint;
- property OnManualBuild: TfrxNotifyEvent read FOnManualBuild write FOnManualBuild;
- end;
- TfrxDialogPage = class(TfrxPage)
- private
- FBorderStyle: TFormBorderStyle;
- FCaption: String;
- FColor: TColor;
- FForm: TForm;
- FOnActivate: TfrxNotifyEvent;
- FOnClick: TfrxNotifyEvent;
- FOnDeactivate: TfrxNotifyEvent;
- FOnHide: TfrxNotifyEvent;
- FOnShow: TfrxNotifyEvent;
- FOnCloseQuery: TfrxCloseQueryEvent;
- FPosition: TPosition;
- FWindowState: TWindowState;
- FOnResize: TfrxNotifyEvent;
- procedure DoInitialize;
- procedure DoOnActivate(Sender: TObject);
- procedure DoOnClick(Sender: TObject);
- procedure DoOnCloseQuery(Sender: TObject; var CanClose: Boolean);
- procedure DoOnDeactivate(Sender: TObject);
- procedure DoOnHide(Sender: TObject);
- procedure DoOnShow(Sender: TObject);
- procedure DoOnResize(Sender: TObject);
- procedure SetBorderStyle(const Value: TFormBorderStyle);
- procedure SetCaption(const Value: String);
- procedure SetColor(const Value: TColor);
- function GetModalResult: TModalResult;
- procedure SetModalResult(const Value: TModalResult);
- protected
- procedure SetLeft(Value: Extended); override;
- procedure SetTop(Value: Extended); override;
- procedure SetWidth(Value: Extended); override;
- procedure SetHeight(Value: Extended); override;
- procedure FontChanged(Sender: TObject); override;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- class function GetDescription: String; override;
- procedure Initialize;
- function ShowModal: TModalResult;
- property DialogForm: TForm read FForm;
- property ModalResult: TModalResult read GetModalResult write SetModalResult;
- published
- property BorderStyle: TFormBorderStyle read FBorderStyle write SetBorderStyle default bsSizeable;
- property Caption: String read FCaption write SetCaption;
- property Color: TColor read FColor write SetColor default clBtnFace;
- property Height;
- property Left;
- property Position: TPosition read FPosition write FPosition default poScreenCenter;
- property Top;
- property Width;
- property WindowState: TWindowState read FWindowState write FWindowState default wsNormal;
- property OnActivate: TfrxNotifyEvent read FOnActivate write FOnActivate;
- property OnClick: TfrxNotifyEvent read FOnClick write FOnClick;
- property OnCloseQuery: TfrxCloseQueryEvent read FOnCloseQuery write FOnCloseQuery;
- property OnDeactivate: TfrxNotifyEvent read FOnDeactivate write FOnDeactivate;
- property OnHide: TfrxNotifyEvent read FOnHide write FOnHide;
- property OnShow: TfrxNotifyEvent read FOnShow write FOnShow;
- property OnResize: TfrxNotifyEvent read FOnResize write FOnResize;
- end;
- { Report }
- TfrxEngineOptions = class(TPersistent)
- private
- FConvertNulls: Boolean;
- FDoublePass: Boolean;
- FMaxMemSize: Integer;
- FPrintIfEmpty: Boolean;
- FReportThread: TThread;
- FSilentMode: Boolean;
- FTempDir: String;
- FUseFileCache: Boolean;
- public
- constructor Create;
- procedure Assign(Source: TPersistent); override;
- procedure Clear;
- property ReportThread: TThread read FReportThread write FReportThread;
- published
- property ConvertNulls: Boolean read FConvertNulls write FConvertNulls default True;
- property DoublePass: Boolean read FDoublePass write FDoublePass default False;
- property MaxMemSize: Integer read FMaxMemSize write FMaxMemSize default 10;
- property PrintIfEmpty: Boolean read FPrintIfEmpty write FPrintIfEmpty default True;
- property SilentMode: Boolean read FSilentMode write FSilentMode default False;
- property TempDir: String read FTempDir write FTempDir;
- property UseFileCache: Boolean read FUseFileCache write FUseFileCache default False;
- end;
- TfrxPrintOptions = class(TPersistent)
- private
- FCopies: Integer;
- FCollate: Boolean;
- FPageNumbers: String;
- FPrinter: String;
- FPrintPages: TfrxPrintPages;
- FShowDialog: Boolean;
- public
- constructor Create;
- procedure Assign(Source: TPersistent); override;
- procedure Clear;
- published
- property Copies: Integer read FCopies write FCopies default 1;
- property Collate: Boolean read FCollate write FCollate default True;
- property PageNumbers: String read FPageNumbers write FPageNumbers;
- property Printer: String read FPrinter write FPrinter;
- property PrintPages: TfrxPrintPages read FPrintPages write FPrintPages default ppAll;
- property ShowDialog: Boolean read FShowDialog write FShowDialog default True;
- end;
- TfrxPreviewOptions = class(TPersistent)
- private
- FAllowEdit: Boolean;
- FButtons: TfrxPreviewButtons;
- FDoubleBuffered: Boolean;
- FMaximized: Boolean;
- FMDIChild: Boolean;
- FModal: Boolean;
- FOutlineVisible: Boolean;
- FOutlineWidth: Integer;
- FShowCaptions: Boolean;
- FZoom: Extended;
- FZoomMode: TfrxZoomMode;
- public
- constructor Create;
- procedure Assign(Source: TPersistent); override;
- procedure Clear;
- published
- property AllowEdit: Boolean read FAllowEdit write FAllowEdit default True;
- property Buttons: TfrxPreviewButtons read FButtons write FButtons;
- property DoubleBuffered: Boolean read FDoubleBuffered write FDoubleBuffered default True;
- property Maximized: Boolean read FMaximized write FMaximized default True;
- property MDIChild: Boolean read FMDIChild write FMDIChild default False;
- property Modal: Boolean read FModal write FModal default True;
- property OutlineVisible: Boolean read FOutlineVisible write FOutlineVisible default False;
- property OutlineWidth: Integer read FOutlineWidth write FOutlineWidth default 120;
- property ShowCaptions: Boolean read FShowCaptions write FShowCaptions default False;
- property Zoom: Extended read FZoom write FZoom;
- property ZoomMode: TfrxZoomMode read FZoomMode write FZoomMode default zmDefault;
- end;
- TfrxReportOptions = class(TPersistent)
- private
- FAuthor: String;
- FCompressed: Boolean;
- FCreateDate: TDateTime;
- FDescription: TStrings;
- FInitString: String;
- FName: String;
- FLastChange: TDateTime;
- FPassword: String;
- FPicture: TPicture;
- FVersionBuild: String;
- FVersionMajor: String;
- FVersionMinor: String;
- FVersionRelease: String;
- procedure SetDescription(const Value: TStrings);
- procedure SetPicture(const Value: TPicture);
- public
- constructor Create;
- destructor Destroy; override;
- procedure Assign(Source: TPersistent); override;
- procedure Clear;
- function CheckPassword: Boolean;
- published
- property Author: String read FAuthor write FAuthor;
- property Compressed: Boolean read FCompressed write FCompressed default False;
- property CreateDate: TDateTime read FCreateDate write FCreateDate;
- property Description: TStrings read FDescription write SetDescription;
- property InitString: String read FInitString write FInitString;
- property Name: String read FName write FName;
- property LastChange: TDateTime read FLastChange write FLastChange;
- property Password: String read FPassword write FPassword;
- property Picture: TPicture read FPicture write SetPicture;
- property VersionBuild: String read FVersionBuild write FVersionBuild;
- property VersionMajor: String read FVersionMajor write FVersionMajor;
- property VersionMinor: String read FVersionMinor write FVersionMinor;
- property VersionRelease: String read FVersionRelease write FVersionRelease;
- end;
- TfrxExpressionCache = class(TObject)
- private
- FExpressions: TStringList;
- FScript: TfsScript;
- public
- constructor Create(AScript: TfsScript);
- destructor Destroy; override;
- procedure Clear;
- function Calc(const Expression: String; var ErrorMsg: String): Variant;
- end;
- TfrxDataSetItem = class(TCollectionItem)
- private
- FDataSet: TfrxDataSet;
- FDataSetName: String;
- procedure SetDataSet(const Value: TfrxDataSet);
- procedure SetDataSetName(const Value: String);
- function GetDataSetName: String;
- published
- property DataSet: TfrxDataSet read FDataSet write SetDataSet;
- property DataSetName: String read GetDataSetName write SetDataSetName;
- end;
- TfrxReportDataSets = class(TCollection)
- private
- FReport: TfrxReport;
- function GetItem(Index: Integer): TfrxDataSetItem;
- public
- constructor Create(AReport: TfrxReport);
- procedure Initialize;
- procedure Finalize;
- procedure Add(ds: TfrxDataSet);
- function Find(ds: TfrxDataSet): TfrxDataSetItem; overload;
- function Find(const Name: String): TfrxDataSetItem; overload;
- property Items[Index: Integer]: TfrxDataSetItem read GetItem; default;
- end;
- TfrxStyleItem = class(TCollectionItem)
- private
- FName: String;
- FColor: TColor;
- FFont: TFont;
- FFrame: TfrxFrame;
- procedure SetFont(const Value: TFont);
- procedure SetFrame(const Value: TfrxFrame);
- procedure SetName(const Value: String);
- public
- constructor Create(Collection: TCollection); override;
- destructor Destroy; override;
- procedure Assign(Source: TPersistent); override;
- procedure CreateUniqueName;
- published
- property Name: String read FName write SetName;
- property Color: TColor read FColor write FColor;
- property Font: TFont read FFont write SetFont;
- property Frame: TfrxFrame read FFrame write SetFrame;
- end;
- TfrxStyles = class(TCollection)
- private
- FName: String;
- FReport: TfrxReport;
- function GetItem(Index: Integer): TfrxStyleItem;
- public
- constructor Create(AReport: TfrxReport);
- function Add: TfrxStyleItem;
- function Find(const Name: String): TfrxStyleItem;
- procedure Apply;
- procedure GetList(List: TStrings);
- procedure LoadFromFile(const FileName: String);
- procedure LoadFromStream(Stream: TStream);
- procedure LoadFromXMLItem(Item: TfrxXMLItem);
- procedure SaveToFile(const FileName: String);
- procedure SaveToStream(Stream: TStream);
- procedure SaveToXMLItem(Item: TfrxXMLItem);
- property Items[Index: Integer]: TfrxStyleItem read GetItem; default;
- property Name: String read FName write FName;
- end;
- TfrxStyleSheet = class(TObject)
- private
- FItems: TList;
- function GetItems(Index: Integer): TfrxStyles;
- public
- constructor Create;
- destructor Destroy; override;
- procedure Clear;
- procedure Delete(Index: Integer);
- procedure GetList(List: TStrings);
- procedure LoadFromFile(const FileName: String);
- procedure LoadFromStream(Stream: TStream);
- procedure SaveToFile(const FileName: String);
- procedure SaveToStream(Stream: TStream);
- function Add: TfrxStyles;
- function Count: Integer;
- function Find(const Name: String): TfrxStyles;
- function IndexOf(const Name: String): Integer;
- property Items[Index: Integer]: TfrxStyles read GetItems; default;
- end;
- TfrxReport = class(TfrxComponent)
- private
- FCurObject: String;
- FDataSet: TfrxDataSet;
- FDataSetName: String;
- FDataSets: TfrxReportDatasets;
- FDesigner: TfrxCustomDesigner;
- FDotMatrixReport: Boolean;
- FDrawText: Pointer;
- FEngine: TfrxCustomEngine;
- FEngineOptions: TfrxEngineOptions;
- FErrors: TStrings;
- FExpressionCache: TfrxExpressionCache;
- FFileName: String;
- FIniFile: String;
- FLoadStream: TStream;
- FLocalValue: TfsCustomVariable;
- FPreviewPages: TfrxCustomPreviewPages;
- FParentForm: TForm;
- FPreview: TfrxCustomPreview;
- FPreviewForm: TForm;
- FPreviewOptions: TfrxPreviewOptions;
- FPrintOptions: TfrxPrintOptions;
- FProgram: TfsScript;
- FReloading: Boolean;
- FReportOptions: TfrxReportOptions;
- FScript: TfsScript;
- FScriptLanguage: String;
- FScriptText: TStrings;
- FStyles: TfrxStyles;
- FSysVariables: TStrings;
- FTimer: TTimer;
- FVariables: TfrxVariables;
- FOnAfterPrint: TfrxBeforePrintEvent;
- FOnBeforePrint: TfrxBeforePrintEvent;
- FOnClickObject: TfrxClickObjectEvent;
- FOnGetValue: TfrxGetValueEvent;
- FOnManualBuild: TfrxManualBuildEvent;
- FOnMouseOverObject: TfrxMouseOverObjectEvent;
- FOnStartReport: TfrxNotifyEvent;
- FOnStopReport: TfrxNotifyEvent;
- FOnUserFunction: TfrxUserFunctionEvent;
- function DoGetValue(const Expr: String; var Value: Variant): Boolean;
- function GetScriptValue(Instance: TObject; ClassType: TClass;
- const MethodName: String; var Params: Variant): Variant;
- function SetScriptValue(Instance: TObject; ClassType: TClass;
- const MethodName: String; var Params: Variant): Variant;
- function DoUserFunction(Instance: TObject; ClassType: TClass;
- const MethodName: String; var Params: Variant): Variant;
- function GetDataSetName: String;
- function GetLocalValue: Variant;
- function GetPages(Index: Integer): TfrxPage;
- function GetPagesCount: Integer;
- procedure DoClear;
- procedure DoLoadFromStream;
- procedure OnTimer(Sender: TObject);
- procedure ReadDatasets(Reader: TReader);
- procedure ReadStyle(Reader: TReader);
- procedure ReadVariables(Reader: TReader);
- procedure SetDataSet(const Value: TfrxDataSet);
- procedure SetDataSetName(const Value: String);
- procedure SetEngineOptions(const Value: TfrxEngineOptions);
- procedure SetLocalValue(const Value: Variant);
- procedure SetPreviewOptions(const Value: TfrxPreviewOptions);
- procedure SetPrintOptions(const Value: TfrxPrintOptions);
- procedure SetReportOptions(const Value: TfrxReportOptions);
- procedure SetScriptText(const Value: TStrings);
- procedure SetStyles(const Value: TfrxStyles);
- procedure WriteDatasets(Writer: TWriter);
- procedure WriteStyle(Writer: TWriter);
- procedure WriteVariables(Writer: TWriter);
- protected
- procedure Notification(AComponent: TComponent; Operation: TOperation); override;
- procedure DefineProperties(Filer: TFiler); override;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Clear; override;
- class function GetDescription: String; override;
- { internal methods }
- function Calc(const Expr: String): Variant;
- function DesignPreviewPage: Boolean;
- function GetAlias(DataSet: TfrxDataSet): String;
- function GetDataset(const Alias: String): TfrxDataset;
- function GetIniFile: TCustomIniFile;
- function PrepareScript: Boolean;
- procedure DoNotifyEvent(Obj: TObject; const EventName: String;
- RunAlways: Boolean = False);
- procedure DoParamEvent(const EventName: String; var Params: Variant;
- RunAlways: Boolean = False);
- procedure DoAfterPrint(c: TfrxReportComponent);
- procedure DoBeforePrint(c: TfrxReportComponent);
- procedure DoPreviewClick(v: TfrxView; Button: TMouseButton;
- Shift: TShiftState; var Modified: Boolean);
- procedure GetDatasetAndField(const ComplexName: String;
- var Dataset: TfrxDataset; var Field: String);
- procedure GetDataSetList(List: TStrings; OnlyDB: Boolean = False);
- procedure SelectPrinter;
- { public methods }
- function LoadFromFile(const FileName: String;
- ExceptionIfNotFound: Boolean = False): Boolean;
- procedure LoadFromStream(Stream: TStream); override;
- procedure SaveToFile(const FileName: String);
- procedure SaveToStream(Stream: TStream; SaveChildren: Boolean = True;
- SaveDefaultValues: Boolean = False); override;
- procedure DesignReport; overload;
- procedure DesignReport(IDesigner: IUnknown; Editor: TObject); overload;
- function PrepareReport(ClearLastReport: Boolean = True): Boolean;
- procedure ShowPreparedReport;
- procedure ShowReport(ClearLastReport: Boolean = True);
- procedure Print;
- procedure Export(Filter: TfrxCustomExportFilter);
- procedure AddFunction(const FuncName: String; const Category: String = '';
- const Description: String = '');
- { internals }
- property CurObject: String read FCurObject write FCurObject;
- property LocalValue: Variant read GetLocalValue write SetLocalValue;
- property Script1: TfsScript read FProgram;
- { public }
- property DataSets: TfrxReportDataSets read FDataSets;
- property Designer: TfrxCustomDesigner read FDesigner;
- property Engine: TfrxCustomEngine read FEngine;
- property Errors: TStrings read FErrors;
- property FileName: String read FFileName write FFileName;
- property PreviewPages: TfrxCustomPreviewPages read FPreviewPages;
- property Pages[Index: Integer]: TfrxPage read GetPages;
- property PagesCount: Integer read GetPagesCount;
- property Script: TfsScript read FScript;
- property Styles: TfrxStyles read FStyles write SetStyles;
- property Variables: TfrxVariables read FVariables;
- published
- property DataSet: TfrxDataSet read FDataSet write SetDataSet;
- property DataSetName: String read GetDataSetName write SetDataSetName;
- property DotMatrixReport: Boolean read FDotMatrixReport write FDotMatrixReport;
- property EngineOptions: TfrxEngineOptions read FEngineOptions write SetEngineOptions;
- property IniFile: String read FIniFile write FIniFile;
- property Preview: TfrxCustomPreview read FPreview write FPreview;
- property PreviewOptions: TfrxPreviewOptions read FPreviewOptions write SetPreviewOptions;
- property PrintOptions: TfrxPrintOptions read FPrintOptions write SetPrintOptions;
- property ReportOptions: TfrxReportOptions read FReportOptions write SetReportOptions;
- property ScriptLanguage: String read FScriptLanguage write FScriptLanguage;
- property ScriptText: TStrings read FScriptText write SetScriptText;
- property OnAfterPrint: TfrxBeforePrintEvent read FOnAfterPrint write FOnAfterPrint;
- property OnBeforePrint: TfrxBeforePrintEvent read FOnBeforePrint write FOnBeforePrint;
- property OnClickObject: TfrxClickObjectEvent read FOnClickObject write FOnClickObject;
- property OnGetValue: TfrxGetValueEvent read FOnGetValue write FOnGetValue;
- property OnManualBuild: TfrxManualBuildEvent read FOnManualBuild write FOnManualBuild;
- property OnMouseOverObject: TfrxMouseOverObjectEvent read FOnMouseOverObject
- write FOnMouseOverObject;
- property OnStartReport: TfrxNotifyEvent read FOnStartReport write FOnStartReport;
- property OnStopReport: TfrxNotifyEvent read FOnStopReport write FOnStopReport;
- property OnUserFunction: TfrxUserFunctionEvent read FOnUserFunction write FOnUserFunction;
- end;
- TfrxCustomDesigner = class(TForm)
- private
- FReport: TfrxReport;
- FIsPreviewDesigner: Boolean;
- FMemoFontName: String;
- FMemoFontSize: Integer;
- FUseObjectFont: Boolean;
- protected
- FModalFinished: Boolean;
- FModified: Boolean;
- FObjects: TList;
- FPage: TfrxPage;
- FSelectedObjects: TList;
- procedure SetModified(const Value: Boolean); virtual;
- procedure SetPage(const Value: TfrxPage); virtual;
- function GetCode: TStrings; virtual; abstract;
- public
- constructor CreateDesigner(AOwner: TComponent; AReport: TfrxReport;
- APreviewDesigner: Boolean = False);
- destructor Destroy; override;
- function InsertExpression(const Expr: String): String; virtual; abstract;
- procedure Lock; virtual; abstract;
- procedure ReloadPages(Index: Integer); virtual; abstract;
- procedure ReloadReport; virtual; abstract;
- procedure UpdateDataTree; virtual; abstract;
- procedure UpdatePage; virtual; abstract;
- property IsPreviewDesigner: Boolean read FIsPreviewDesigner;
- property Modified: Boolean read FModified write SetModified;
- property Objects: TList read FObjects;
- property Report: TfrxReport read FReport;
- property SelectedObjects: TList read FSelectedObjects;
- property Page: TfrxPage read FPage write SetPage;
- property Code: TStrings read GetCode;
- property UseObjectFont: Boolean read FUseObjectFont write FUseObjectFont;
- property MemoFontName: String read FMemoFontName write FMemoFontName;
- property MemoFontSize: Integer read FMemoFontSize write FMemoFontSize;
- end;
- TfrxDesignerClass = class of TfrxCustomDesigner;
- TfrxCustomExportFilter = class(TComponent)
- private
- FCurPage: Boolean;
- FNoRegister: Boolean;
- FPageNumbers: String;
- FReport: TfrxReport;
- FShowDialog: Boolean;
- protected
- public
- constructor Create(AOwner: TComponent); override;
- constructor CreateNoRegister;
- destructor Destroy; override;
- class function GetDescription: String; virtual;
- function ShowModal: TModalResult; virtual;
- function Start: Boolean; virtual;
- procedure ExportObject(Obj: TfrxComponent); virtual; abstract;
- procedure Finish; virtual;
- procedure FinishPage(Page: TfrxReportPage; Index: Integer); virtual;
- procedure StartPage(Page: TfrxReportPage; Index: Integer); virtual;
- property CurPage: Boolean read FCurPage write FCurPage;
- property PageNumbers: String read FPageNumbers write FPageNumbers;
- property Report: TfrxReport read FReport write FReport;
- published
- property ShowDialog: Boolean read FShowDialog write FShowDialog default True;
- end;
- TfrxCustomWizard = class(TComponent)
- private
- FDesigner: TfrxCustomDesigner;
- FReport: TfrxReport;
- public
- constructor Create(AOwner: TComponent); override;
- class function GetDescription: String; virtual;
- function Execute: Boolean; virtual; abstract;
- property Designer: TfrxCustomDesigner read FDesigner;
- property Report: TfrxReport read FReport;
- end;
- TfrxWizardClass = class of TfrxCustomWizard;
- TfrxCustomEngine = class(TPersistent)
- private
- FCurColumn: Integer;
- FCurVColumn: Integer;
- FCurLine: Integer;
- FCurLineThrough: Integer;
- FCurX: Extended;
- FCurY: Extended;
- FFinalPass: Boolean;
- FFooterHeight: Extended;
- FHeaderHeight: Extended;
- FPageHeight: Extended;
- FPageWidth: Extended;
- FPreviewPages: TfrxCustomPreviewPages;
- FReport: TfrxReport;
- FRunning: Boolean;
- FStartDate: TDateTime;
- FStartTime: TDateTime;
- FTotalPages: Integer;
- FOnRunDialog: TfrxRunDialogEvent;
- function GetDoublePass: Boolean;
- protected
- public
- constructor Create(AReport: TfrxReport); virtual;
- procedure EndPage; virtual; abstract;
- procedure NewColumn; virtual; abstract;
- procedure NewPage; virtual; abstract;
- procedure ShowBand(Band: TfrxBand); overload; virtual; abstract;
- procedure ShowBand(Band: TfrxBandClass); overload; virtual; abstract;
- procedure StopReport;
- function FreeSpace: Extended; virtual; abstract;