📄 qexport4options.pas
字号:
unit QExport4Options;
interface
uses Classes, Graphics, QExport4, QExport4HTML, QExport4PDF, QExport4XLS,
QExport4RTF;
type
TQExportOptions = class(TPersistent)
private
FHolder: TPersistent;
protected
function GetOwner: TPersistent; override;
public
constructor Create(Holder: TPersistent);
end;
TQExportRTFOptions = class(TQExportOptions)
private
FCaptionAligns: TStrings;
FCaptionStyle: TrtfStyle;
FDataStyle: TrtfStyle;
// FDefaultCaptionAlign: TQExportColAlign;
FFooterStyle: TrtfStyle;
FHeaderStyle: TrtfStyle;
FPageOrientation: TQExportPageOrientation;
FStripStyles: TrtfStyles;
FStripType: TrtfStripType;
procedure SetCaptionAligns(const Value: TStrings);
procedure SetCaptionStyle(const Value: TrtfStyle);
procedure SetDataStyle(const Value: TrtfStyle);
procedure SetFooterStyle(const Value: TrtfStyle);
procedure SetHeaderStyle(const Value: TrtfStyle);
procedure SetStripStyles(const Value: TrtfStyles);
public
constructor Create(Holder: TPersistent);
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
published
property CaptionAligns: TStrings read FCaptionAligns
write SetCaptionAligns;
property CaptionStyle: TrtfStyle read FCaptionStyle
write SetCaptionStyle;
property DataStyle: TrtfStyle read FDataStyle
write SetDataStyle;
// property DefaultCaptionAlign: TQExportColAlign
// read FDefaultCaptionAlign write FDefaultCaptionAlign
// default ecaCenter;
property FooterStyle: TrtfStyle read FFooterStyle
write SetFooterStyle;
property HeaderStyle: TrtfStyle read FHeaderStyle
write SetHeaderStyle;
property PageOrientation: TQExportPageOrientation
read FPageOrientation write FPageOrientation
default poPortrait;
property StripStyles: TrtfStyles read FStripStyles
write SetStripStyles;
property StripType: TrtfStripType read FStripType
write FStripType default stNone;
end;
TQExportXMLOptions = class(TQExportOptions)
private
FStandalone: boolean;
FEncoding: string;
function IsEncoding: boolean;
public
constructor Create(Holder: TPersistent);
procedure Assign(Source: TPersistent); override;
published
property Standalone: boolean read FStandalone write FStandalone default true;
property Encoding: string read FEncoding write FEncoding stored IsEncoding;
end;
TQExportSQLOptions = class(TQExportOptions)
private
FTableName: string;
FCreateTable: boolean;
FCommitRecCount: integer;
FCommitAfterScript: boolean;
FCommitStatement: string;
FStatementTerm: char;
function IsTableName: boolean;
function IsCommitStatement: boolean;
public
constructor Create(Holder: TPersistent);
procedure Assign(Source: TPersistent); override;
published
property TableName: string read FTableName write FTableName
stored IsTableName;
property CreateTable: boolean read FCreateTable write FCreateTable
default false;
property CommitRecCount: integer read FCommitRecCount write FCommitRecCount
default 0;
property CommitAfterScript: boolean read FCommitAfterScript
write FCommitAfterScript default false;
property CommitStatement: string read FCommitStatement
write FCommitStatement stored IsCommitStatement;
property StatementTerm: char read FStatementTerm write FStatementTerm
default ';';
end;
TQExportHTMLTableOptions = class(TQExportOptions)
private
FBorderWidth: integer;
FCellPadding: integer;
FCellSpacing: integer;
FAdvancedAttributes: TStrings;
FHeadersRowBgColor: TColor;
FHeadersRowFontColor: TColor;
FTableBgColor: TColor;
FTableFontColor: TColor;
FOddRowBgColor: TColor;
FBorderColor: TColor;
FBackgroundFileName: string;
procedure SetAdvancedAttributes(const Value: TStrings);
function IsBackgroundFileName: boolean;
public
constructor Create(Holder: TPersistent);
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
published
property BorderWidth: integer read FBorderWidth write FBorderWidth
default 1;
property CellPadding: integer read FCellPadding write FCellPadding
default 4;
property CellSpacing: integer read FCellSpacing write FCellSpacing
default 1;
property AdvancedAttributes: TStrings read FAdvancedAttributes
write SetAdvancedAttributes;
property HeadersRowBgColor: TColor read FHeadersRowBgColor
write FHeadersRowBgColor default $000000FF;
property HeadersRowFontColor: TColor read FHeadersRowFontColor
write FHeadersRowFontColor default $00FFFFFF;
property TableBgColor: TColor read FTableBgColor write FTableBgColor
default $00EC7A00;
property TableFontColor: TColor read FTableFontColor write FTableFontColor
default $00FFFFFF;
property OddRowBgColor: TColor read FOddRowBgColor write FOddRowBgColor
default $00CE6B00;
property BorderColor: TColor read FBorderColor write FBorderColor
default clWhite;
property BackgroundFileName: string read FBackgroundFileName
write FBackgroundFileName stored IsBackgroundFileName;
end;
TQExportHTMLPageOptions = class(TQExportOptions)
private
FTitle: string;
FBackgroundColor: TColor;
FTextFont: TFont;
FDefaultOptions: TDefaultOptions;
FLinkColor: TColor;
FVLinkColor: TColor;
FALinkColor: TColor;
FBackgroundFileName: string;
FAdvancedAttributes: TStrings;
FUsingCSS: TUsingCSS;
FCSSFileName: string;
FOverwriteCSSFile: boolean;
FBoolAsCheckBox: boolean;
function IsTitle: boolean;
procedure SetTextFont(const Value: TFont);
function IsBackgroundFilename: boolean;
procedure SetAdvancedAttributes(const Value: TStrings);
function IsCSSFileName: boolean;
public
constructor Create(Holder: TPersistent);
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
published
property Title: string read FTitle write FTitle stored IsTitle;
property BackgroundColor: TColor read FBackgroundColor
write FBackgroundColor default $00993333;
property TextFont: TFont read FTextFont write SetTextFont;
property DefaultOptions: TDefaultOptions read FDefaultOptions
write FDefaultOptions default [doFontSIze];
property LinkColor: TColor read FLinkColor write FLinkColor
default $007DEF69;
property VLinkColor: TColor read FVLinkColor write FVLinkColor
default $00FF00FF;
property ALinkColor: TColor read FALinkColor write FALinkColor
default $0000FF00;
property BackgroundFileName: string read FBackgroundFileName
write FBackgroundFileName stored IsBackgroundFileName;
property AdvancedAttributes: TStrings read FAdvancedAttributes
write SetAdvancedAttributes;
property UsingCSS: TUsingCSS read FUsingCSS write FUsingCSS
default usInternal;
property CSSFileName: string read FCSSFileName write FCSSFileName
stored IsCSSFileName;
property OverwriteCSSFile: boolean read FOverwriteCSSFile
write FOverwriteCSSFile default true;
property BoolAsCheckBox: boolean read FBoolAsCheckBox
write FBoolAsCheckBox default false;
end;
TQExportHTMLMultiFileOptions = class(TQExportOptions)
private
FFileRecCount: integer;
FGenerateIndex: boolean;
FIndexLinkTemplate: string;
FNavigationOnTop: boolean;
FNavigationOnBottom: boolean;
FIndexLinkTitle: string;
FFirstLinkTitle: string;
FPriorLinkTitle: string;
FNextLinkTitle: string;
FLastLinkTitle: string;
function IsIndexLinkTemplate: boolean;
function IsIndexLinkTitle: boolean;
function IsFirstLinkTitle: boolean;
function IsPriorLinkTitle: boolean;
function IsNextLinkTitle: boolean;
function IsLastLinkTitle: boolean;
public
constructor Create(Holder: TPersistent);
procedure Assign(Source: TPersistent); override;
published
property FileRecCount: integer read FFileRecCount write FFileRecCount
default 0;
property GenerateIndex: boolean read FGenerateIndex write FGenerateIndex
default false;
property IndexLinkTemplate: string read FIndexLinkTemplate
write FIndexLinkTemplate stored IsIndexLinkTemplate;
property NavigationOnTop: boolean read FNavigationOnTop
write FNavigationOnTop default true;
property NavigationOnBottom: boolean read FNavigationOnBottom
write FNavigationOnBottom default true;
property IndexLinkTitle: string read FIndexLinkTitle write FIndexLinkTitle
stored IsIndexLinkTitle;
property FirstLinkTitle: string read FFirstLinkTitle write FFirstLinkTitle
stored IsFirstLinkTitle;
property PriorLinkTitle: string read FPriorLinkTitle write FPriorLinkTitle
stored IsPriorLinkTitle;
property NextLinkTitle: string read FNextLinkTitle write FNextLinkTitle
stored IsNextLinkTitle;
property LastLinkTitle: string read FLastLinkTitle write FLastLinkTitle
stored IsLastLinkTitle;
end;
TQExportTXTOptions = class(TQExportOptions)
private
FAutoCalcColWidth: boolean;
FColSpacing: integer;
public
constructor Create(Holder: TPersistent);
procedure Assign(Source: TPersistent); override;
published
property AutoCalcColWidth: boolean read FAutoCalcColWidth
write FAutoCalcColWidth default true;
property ColSpacing: integer read FColSpacing write FColSpacing default 1;
end;
TQExportCSVOptions = class(TQExportOptions)
private
FComma: char;
FQuote: char;
FQuoteStrings: boolean;
public
constructor Create(Holder: TPersistent);
procedure Assign(Source: TPersistent); override;
published
property Comma: char read FComma write FComma;
property Quote: char read FQuote write FQuote default '"';
property QuoteStrings: boolean read FQuoteStrings write FQuoteStrings
default true;
end;
TQExportPDFOptions = class(TQExportOptions)
private
FPageOptions: TQExportPDFPageOptions;
FHeaderFont: TPDFFont;
FCaptionFont: TPDFFont;
FDataFont: TPDFFont;
FFooterFont: TPDFFont;
FRowSpacing: double;
FColSpacing: double;
FGridLineWidth: integer;
function IsRowSpacing: boolean;
function IsColSpacing: boolean;
procedure SetPageOptions(const Value: TQExportPDFPageOptions);
procedure SetCaptionFont(const Value: TPDFFont);
procedure SetDataFont(const Value: TPDFFont);
procedure SetFooterFont(const Value: TPDFFont);
procedure SetHeaderFont(const Value: TPDFFont);
public
constructor Create(Holder: TPersistent);
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
published
property PageOptions: TQExportPDFPageOptions read FPageOptions
write SetPageOptions;
property HeaderFont: TPDFFont read FHeaderFont write SetHeaderFont;
property CaptionFont: TPDFFont read FCaptionFont write SetCaptionFont;
property DataFont: TPDFFont read FDataFont write SetDataFont;
property FooterFont: TPDFFont read FFooterFont write SetFooterFont;
property RowSpacing: double read FRowSpacing write FRowSpacing
stored IsRowSpacing;
property ColSpacing: double read FColSpacing write FColSpacing
stored IsColSpacing;
property GridLineWidth: integer read FGridLineWidth write FGridLineWidth
default 1;
end;
TQExportAccessOptions = class(TQExportOptions)
private
FPassword: string;
FTableName: string;
FCreateTable: boolean;
function IsPassword: Boolean;
function IsTableName: boolean;
public
constructor Create(Holder: TPersistent);
procedure Assign(Source: TPersistent); override;
published
property Password: string read FPassword write FPassword
stored IsPassword;
property TableName: string read FTableName write FTableName
stored IsTableName;
property CreateTable: boolean read FCreateTable write FCreateTable
default true;
end;
TQExportXLSOptions = class(TQExportOptions)
private
FAutoCalcColWidth: boolean;
FPageHeader: string;
FPageFooter: string;
FSheetTitle: string;
FPageBackground: string;
FHeaderFormat: TxlsFormat;
FCaptionFormat: TxlsFormat;
FDataFormat: TxlsFormat;
FAggregateFormat: TxlsFormat;
FFooterFormat: TxlsFormat;
FFieldFormats: TxlsFieldFormats;
FStripStyles: TxlsFormats;
FStripType: TxlsStripType;
FHyperlinks: TxlsHyperlinks;
FNotes: TxlsNotes;
FCharts: TxlsCharts;
FHyperlinkFormat: TxlsFormat;
FNoteFormat: TxlsNoteFormat;
FPictures: TxlsPictures;
FImages: TxlsImages;
FCells: TxlsCells;
FMergedCells: TxlsMergedCellList;
function IsPageHeader: Boolean;
function IsPageFooter: Boolean;
procedure SetSheetTitle(const Value: string);
procedure SetHeaderFormat(const Value: TxlsFormat);
procedure SetCaptionFormat(const Value: TxlsFormat);
procedure SetDataFormat(const Value: TxlsFormat);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -