rm_class.pas
来自「胜天进销存源码,国产优秀的进销存」· PAS 代码 · 共 1,744 行 · 第 1/5 页
PAS
1,744 行
procedure SetOutlineText(Value: string);
function GetAlignToBottom: Boolean;
procedure SetAlignToBottom(Value: Boolean);
function GetPrintIfEmpty: Boolean;
procedure SetPrintIfEmpty(Value: Boolean);
procedure SetNewPageCondition(Value: string);
procedure SetRangeEndCount(Value: Integer);
protected
property AlignToBottom: Boolean read GetAlignToBottom write SetAlignToBottom;
property PrintOnFirstPage: Boolean read GetPrintOnFirstPage write SetPrintOnFirstPage;
property PrintOnLastPage: Boolean read GetPrintOnLastPage write SetPrintOnLastPage;
property PrintIfSubsetEmpty: Boolean read GetPrintIfSubsetEmpty write SetPrintIfSubsetEmpty;
property AutoAppendBlank: Boolean read GetAutoAppendBlank write SetAutoAppendBlank;
property LinesPerPage: Integer read FLinesPerPage write FLinesPerPage;
property NewPageCondition: string read FNewPageCondition write SetNewPageCondition;
property NewPageAfter: Boolean read GetNewPageAfter write SetNewPageAfter;
property NewPageBefore: Boolean read GetNewPageBefore write SetNewPageBefore;
property PageBreaked: Boolean read GetPageBreaked write SetPageBreaked;
property GroupHeaderBandName: string read FMasterBand write SetGroupHeaderBandName;
property MasterBandName: string read FMasterBand write SetMasterBand; // GroupHeader Band 有的
property DataBandName: string read FDataBandName write SetDataBandName;
property HideIfEmpty: Boolean read GetHideIfEmpty write SetHideIfEmpty;
property ReprintOnNewPage: Boolean read GetReprintOnNewPage write SetReprintOnNewPage;
property ReprintOnEveryPage: Boolean read GetReprintOnNewPage write SetReprintOnNewPage;
property ReprintOnNewColumn: Boolean read GetReprintOnNewColumn write SetReprintOnNewColumn;
property KeepFooter: Boolean read GetKeepFooter write SetKeepFooter;
property KeepTogether: Boolean read GetKeepTogether write SetKeepTogether;
property KeepChild: Boolean read GetKeepChild write SetKeepChild;
property PrintColumnFirst: Boolean read GetPrintColumnFirst write SetPrintColumnFirst;
property Columns: Integer read FColumns write FColumns;
property mmColumnGap: Integer read FmmColumnGap write FmmColumnGap;
property mmColumnWidth: Integer read FmmColumnWidth write FmmColumnWidth;
property mmColumnOffset: Integer read FmmColumnOffset write FmmColumnOffset;
property spColumnGap: Integer index 0 read GetspColumnGap write SetspColumnGap;
property spColumnWidth: Integer index 1 read GetspColumnGap write SetspColumnGap;
property spColumnOffset: Integer index 2 read GetspColumnGap write SetspColumnGap;
property ColumnGap: Double index 0 read GetColumnGap write SetColumnGap;
property ColumnWidth: Double index 1 read GetColumnGap write SetColumnGap;
property ColumnOffset: Double index 2 read GetColumnGap write SetColumnGap;
property GroupCondition: string read FGroupCondition write SetGroupCondition;
property PrintCondition: string read FGroupCondition write SetGroupCondition;
property OutlineText: string read FOutlineText write SetOutlineText;
property PrintAtDesignPos: Boolean read GetPrintatDesignPos write SetPrintatDesignPos;
property DataSetName: string read FDataSetName write SetDataSetName;
property RangeBegin: TRMRangeBegin read FRangeBegin write FRangeBegin;
property RangeEnd: TRMRangeEnd read FRangeEnd write FRangeEnd;
property RangeEndCount: integer read FRangeEndCount write SetRangeEndCount;
property PrintBeforeSummaryBand: Boolean read GetPrintBeforeSummaryBand write SetPrintBeforeSummaryBand;
property ChildBand: string read FChildBandName write SetChildBandName;
property PrintChildIfInvisible: Boolean read GetPrintChildIfInvisible write SetPrintChildIfInvisible;
property PrintIfEmpty: Boolean read GetPrintIfEmpty write SetPrintIfEmpty;
property AdjustColumns: Boolean read GetAdjustColumns write SetAdjustColumns;
public
class function CanPlaceOnGridView: Boolean; override;
constructor Create; override;
destructor Destroy; override;
procedure LoadFromStream(aStream: TStream); override;
procedure SaveToStream(aStream: TStream); override;
procedure DefinePopupMenu(aPopup: TRMCustomMenuItem); override;
function GetClipRgn(rt: TRMRgnType): HRGN; override;
procedure Draw(aCanvas: TCanvas); override;
property IsVirtualDataSet: Boolean read FIsVirtualDataSet;
property BandType: TRMBandType read FBandType;
property CrossDataSetName: string read FCrossDataSetName write SetCrossDataSetName;
published
property Font: TFont read FFont write SetFont;
// property ParentFont;
property OnAfterPrint: TNotifyEvent read FOnAfterPrint write FOnAfterPrint;
end;
{ TRMBand }
TRMBand = class(TRMCustomBandView) // 打印时用的
private
FPositions: array[TRMDatasetPosition] of Integer;
FLastGroupValue: Variant;
FVirtualCrossDataSet: TRMDataSet;
FSaveRangeBegin: TRMRangeBegin;
FSaveRangeEnd: TRMRangeEnd;
FSaveRangeEndCount: Integer;
FCurrentColumn: Integer;
FNowLine: LongInt;
FLevel: Integer;
FFirstPage: Boolean;
FPageBreakFlag: Boolean;
FLastPageNo: Integer;
FAggrCount: Integer;
FAggrValues: TRMVariables;
FNowGroupBand: TRMBand;
FAggrBand: TRMBand;
FDisableBandScript: Boolean;
FBandChild: TRMBand;
FNextGroup, FPrevGroup: TRMBand;
FFirstGroup, FLastGroup: TRMBand;
FHeaderBand, FFooterBand, FDataBand, FLastBand: TRMBand;
FMasterDataBand: TRMBand;
FCalculatedHeight: Integer;
FNeedChangeHeight, FNeedUnStretchObjects: Boolean;
FmmColumnXAdjust: Integer;
FSaveXAdjust, FSaveLastY, FSaveTop, FSaveMaxY: Integer;
FMaxColumns: Integer;
FMaxY: Integer;
FObjects: TList;
FSubReports: TList;
FKeepPage_FirstTime: Boolean;
FNeedDecKeepPageCount: Boolean;
// FCallNewPage, FCallNewColumn: Integer;
procedure MakeOutlineText;
procedure DrawRepeatHeader(aNewColumn: Boolean);
procedure DoAggregate;
procedure InitValues;
procedure StretchObjects;
procedure UnStretchObjects;
function CalcBandHeight: Integer;
function CalcChildBandHeight: Integer;
function CheckSpace(aTop, aHeight: Integer; aAddColumn: Boolean): Boolean;
procedure MakeSpace;
procedure MakeColumns;
procedure PrintObject(t: TRMReportView);
function PrintObjects(aDrawPageBreaked: Boolean): Boolean;
function PrintSubReports: Boolean;
procedure PrintCrossCell(aParentBand: TRMBand; aCurrentX: Integer);
procedure PrintCross;
function HasCross: Boolean;
procedure PrintPageBreak(aNeedNewPage: Boolean);
procedure DoPrint;
function Print: Boolean;
procedure AddAggregateValue(const aStr: string; aValue: Variant);
function GetAggregateValue(const aStr: string): Variant;
protected
function GetPropValue(aObject: TObject; aPropName: string; var aValue: Variant; Args: array of Variant): Boolean; override;
procedure Prepare; override;
procedure UnPrepare; override;
property DataSet: TRMDataSet read FDataSet;
public
constructor Create; override;
destructor Destroy; override;
property Objects: TList read FObjects;
property AggrValues: TRMVariables read FAggrValues;
end;
TRMBandReportTitle = class(TRMBand)
private
protected
public
constructor Create; override;
published
property HideIfEmpty;
// property NewPageAfter;
property Stretched;
property PageBreaked;
property ChildBand;
property KeepChild;
property PrintChildIfInvisible;
property OutlineText;
end;
TRMBandReportSummary = class(TRMBand)
private
protected
public
constructor Create; override;
published
property HideIfEmpty;
// property NewPageAfter;
property Stretched;
//property PageBreaked;
property ChildBand;
property KeepChild;
property PrintChildIfInvisible;
property AlignToBottom;
property OutlineText;
end;
TRMBandPageHeader = class(TRMBand)
private
protected
public
constructor Create; override;
published
property HideIfEmpty;
// property NewPageAfter;
property Stretched;
property PageBreaked;
property PrintOnFirstPage;
property PrintOnLastPage;
//property ChildBand;
property PrintChildIfInvisible;
property OutlineText;
end;
TRMBandPageFooter = class(TRMBand)
private
protected
public
constructor Create; override;
published
property HideIfEmpty;
property PrintOnFirstPage;
property PrintOnLastPage;
property PrintChildIfInvisible;
property OutlineText;
end;
TRMBandColumnHeader = class(TRMBand)
private
protected
public
constructor Create; override;
published
property HideIfEmpty;
// property NewPageAfter;
property Stretched;
property PageBreaked;
property ReprintOnNewColumn;
//property ChildBand;
property PrintChildIfInvisible;
property OutlineText;
end;
TRMBandColumnFooter = class(TRMBand)
private
protected
public
constructor Create; override;
published
property HideIfEmpty;
property PrintBeforeSummaryBand;
//property ChildBand;
property PrintChildIfInvisible;
property OutlineText;
end;
TRMBandHeader = class(TRMBand)
private
protected
public
constructor Create; override;
published
property HideIfEmpty;
// property NewPageBefore;
property NewPageAfter;
property Stretched;
property PageBreaked;
property ReprintOnNewPage;
property ReprintOnNewColumn;
property ChildBand;
property KeepChild;
property PrintChildIfInvisible;
property DataBandName;
property OutlineText;
end;
TRMBandFooter = class(TRMBand)
private
protected
public
constructor Create; override;
published
property HideIfEmpty;
// property NewPageBefore;
property NewPageAfter;
property Stretched;
property PageBreaked;
// property ReprintOnEveryPage;
property ChildBand;
property KeepChild;
property PrintChildIfInvisible;
property DataBandName;
property OutlineText;
end;
TRMBandMasterData = class(TRMBand)
private
protected
public
constructor Create; override;
published
property PrintCondition;
property HideIfEmpty;
// property NewPageBefore;
property NewPageAfter;
property Stretched;
property PageBreaked;
property ColumnGap;
property Columns;
property ColumnWidth;
property ColumnOffset;
property DataSetName;
property PrintIfSubsetEmpty;
property PrintColumnFirst;
// property PrintAtDesignPos;
property LinesPerPage;
property AutoAppendBlank;
property RangeBegin;
property RangeEnd;
property RangeEndCount;
property PrintChildIfInvisible;
property PrintIfEmpty;
property NewPageCondition;
property OutlineText;
property AdjustColumns;
property ChildBand;
property KeepChild;
property KeepFooter;
property KeepTogether;
end;
TRMBandDetailData = class(TRMBandMasterData)
private
protected
public
constructor Create; override;
published
property MasterBandName;
end;
{@TRMBandGroupHeader.BreakNo
This property indicates the number of times a group break has occurred. If
the group never breaks during the course of report generation, the BreakNo
will be 0.
@TRMBandGroupHeader.ResetPageNo
Use ResetPageNo to enable subset page numbering.
ResetPageNo is only available when a report group has the NewPage property
set to True.
@TRMBandGroupHeader.HeaderForOrphanedFooter
Defaults to True. When the group footer is orphaned (prints alone at the top
of a page with no preceding detail bands) then this property determines
whether the group header will be printed.
@TRMBandGroupHeader.KeepTogether
Defaults to True. This property indicates whether groups can break across
pages. If the group cannot fit on the remaining space of a page, the group
will advance to the next page and print there. If the group advances to the
next page and still will not fit, then the group will break across pages
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?