⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qexport4xls.pas

📁 Advanced.Export.Component.v4.01.rar,delphi 第三方控件
💻 PAS
📖 第 1 页 / 共 5 页
字号:
  private
    FAutoPosition: TxlsChartAutoPosition;
    FCustomPosition: TxlsChartCustomPosition;
    FPositionType: TxlsChartPositionType;
    procedure SetAutoPosition(const Value: TxlsChartAutoPosition);
    procedure SetCustomPosition(const Value: TxlsChartCustomPosition);
  public
    constructor Create;
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;
    procedure SaveToIniFile(IniFile: TQIniFile; const Section: string);
    procedure LoadFromIniFile(IniFile: TQIniFile; const Section: string);
  published
    property AutoPosition: TxlsChartAutoPosition read FAutoPosition
      write SetAutoPosition;
    property CustomPosition: TxlsChartCustomPosition read FCustomPosition
      write SetCustomPosition;
    property PositionType: TxlsChartPositionType read FPositionType
      write FPositionType default cptAuto;
  end;

  TxlsSheet = class;

  TxlsChart = class(TxlsCustomItem)
  private
    FAutoColor: boolean;
    FCategoryLabels: TxlsDataRange;
    FCategoryLabelsType: TxlsRangeType;
    FCategoryLabelsColumn: string;
    FLegendPlacement: TxlsChartLegendPlacement;
    FPosition: TxlsChartPosition;
    FSeries: TxlsChartSeriesList;
    FShowLegend: boolean;
    FStyle: TxlsChartStyle;
    FTitle: WideString;

    procedure SetCategoryLabels(const Value: TxlsDataRange);
    procedure SetPosition(const Value: TxlsChartPosition);
    procedure SetSeries(const Value: TxlsChartSeriesList);
    function GetAnchor: TMSO_Anchor;
    function GetSheet: TxlsSheet;
  protected
    function GetItemType: TxlsItemType; override;
    function  GetDisplayName: string; override;
  public
    constructor Create(Collection: TCollection); override;
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;
    procedure SaveToIniFile(IniFile: TQIniFile; const Section: string);
    procedure LoadFromIniFile(IniFile: TQIniFile; const Section: string);
    property Sheet: TxlsSheet read GetSheet;
  published
    property AutoColor: boolean read FAutoColor write FAutoColor default true;
    property CategoryLabels: TxlsDataRange read FCategoryLabels
      write SetCategoryLabels;
    property CategoryLabelsType: TxlsRangeType read FCategoryLabelsType
      write FCategoryLabelsType default rtColumn;
    property CategoryLabelsColumn: string read FCategoryLabelsColumn
      write FCategoryLabelsColumn;
    property LegendPlacement: TxlsChartLegendPlacement
      read FLegendPlacement write FLegendPlacement default clpRight;
    property Position: TxlsChartPosition read FPosition write SetPosition;
    property Series: TxlsChartSeriesList read FSeries
      write SetSeries;
    property ShowLegend: boolean read FShowLegend
      write FShowLegend default true;
    property Style: TxlsChartStyle read FStyle
      write FStyle default xcsColumn;
    property Title: WideString read FTitle write FTitle;
  end;

  TxlsCharts = class(TCollection)
  private
    FHolder: TPersistent;
  protected
    function GetOwner: TPersistent; override;
    function GetItem(Index: integer): TxlsChart;
    procedure SetItem(Index: integer; Value: TxlsChart);
  public
    constructor Create(Holder: TPersistent);
    function Add: TxlsChart;

    property Holder: TPersistent read FHolder;
    property Items[Index: integer]: TxlsChart read GetItem
      write SetItem; default;
  end;

  TxlsGraphicType = (gtUnknown, gtWMF, gtEMF, gtJPG, gtPNG, gtGIF, gtBMP,
    gtICO);

  TxlsGraphic = class(TxlsCustomItem)
  private
    FFileName: string;
    FHeight: integer;
    FStream: TMemoryStream;
    FWidth: integer;
    FGraphicType: TxlsGraphicType;

    procedure SetFileName(const Value: string);
    procedure SetStream(Value: TMemoryStream);
  protected
    function GetItemType: TxlsItemType; override;
  public
    constructor Create(Collection: TCollection); override;
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;
    function IsFileSource: boolean;

    property GraphicType: TxlsGraphicType read FGraphicType;
    property Height: integer read FHeight write FHeight;
    property Stream: TMemoryStream read FStream write SetStream;
    property Width: integer read FWIdth write FWidth;
  published
    property FileName: string read FFileName write SetFileName;
  end;

  TxlsPictures = class;

  TxlsPictureType = (ptUndefined, ptUndefined2, ptWMF, ptEMF, ptPICT, ptJPEG,
    ptPNG, ptDIB);

  TxlsPicture = class(TxlsGraphic)
  private
    FName: string;
    FPictures: TxlsPictures;
    FPictureType: TxlsPictureType;

    function CalcRefCount: integer;
    procedure GetMeasurements(var H, W: integer);
    procedure SetName(const Value: string);
  protected
    function GetItemType: TxlsItemType; override;
    function  GetDisplayName: string; override;
  public
    constructor Create(Collection: TCollection); override;
    procedure Assign(Source: TPersistent); override;
    procedure SaveToIniFile(IniFile: TQIniFile; const Section: string);
    procedure LoadFromIniFile(IniFile: TQIniFile; const Section: string);

    property Pictures: TxlsPictures read FPictures;
    property PictureType: TxlsPictureType read FPictureType
      write FPictureType default ptUndefined;
  published
    property Name: string read FName write SetName;
  end;

  TxlsPictures = class(TCollection)
  private
    FHolder: TPersistent;
  protected
    function GetOwner: TPersistent; override;
    function GetItem(Index: integer): TxlsPicture;
    procedure SetItem(Index: integer; Value: TxlsPicture);
  public
    constructor Create(Holder: TPersistent);
    function Add: TxlsPicture;
    function Find(const Name: string; var Index: integer): boolean;

    property Holder: TPersistent read FHolder;
    property Items[Index: integer]: TxlsPicture read GetItem
      write SetItem; default;
  end;

  TxlsImages = class;

  TxlsZoom = 0..1000;

  TxlsImage = class(TxlsCustomItem)
  private
    FCol: word;
    FImages: TxlsImages;
    FPictureName: string;
    FQExportXLS: TQExport4XLS;
    FRow: word;
    FSheet: TxlsSheet;
    FTitle: WideString;
    FZoom: TxlsZoom;

    function GetPictureIndex: integer;
    function GetAnchor: TMSO_Anchor;
  protected
    function GetItemType: TxlsItemType; override;
    function  GetDisplayName: string; override;
  public
    constructor Create(Collection: TCollection); override;
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;
    procedure SaveToIniFile(IniFile: TQIniFile; const Section: string);
    procedure LoadFromIniFile(IniFile: TQIniFile; const Section: string);

    property Images: TxlsImages read FImages;
    property PictureIndex: integer read GetPictureIndex;
  published
    property Col: word read FCol write FCol default 0; // 1 - based
    property PictureName: string read FPictureName write FPictureName;
    property Row: word read FRow write FRow default 0; // 1 - based
    property Title: WideString read FTitle write FTitle;
    property Zoom: TxlsZoom read FZoom write FZoom default 100;
  end;

  TxlsImages = class(TCollection)
  private
    FHolder: TPersistent;
  protected
    function GetOwner: TPersistent; override;
    function GetItem(Index: integer): TxlsImage;
    procedure SetItem(Index: integer; Value: TxlsImage);
  public
    constructor Create(Holder: TPersistent);
    function Add: TxlsImage;
    function Find(const Title: string; var Index: integer): boolean;

    property Holder: TPersistent read FHolder;
    property Items[Index: integer]: TxlsImage read GetItem
      write SetItem; default;
  end;

  TxlsCells = class;

  TxlsCellType = (ctBoolean, ctDateTime, ctNumeric, ctString);

  TxlsCell = class(TxlsCustomItem)
  private
    FCellType: TxlsCellType;
    FCol: word;
    FDateTimeFormat: string;
    FFormat: TxlsFormat;
    FNumericFormat: string;
    FRow: word;
    FBooleanValue: boolean;
    FDateTimeValue: TDateTime;
    FNumericValue: double;
    FStringValue: string;

    function GetIsBoolean: boolean;
    function GetIsDateTime: boolean;
    function GetIsNumeric: boolean;
    function GetIsString: boolean;
    function GetValue: Variant;
    procedure SetFormat(Value: TxlsFormat);
    procedure SetValue(Value: Variant);
  private
    function IsCorrect: boolean;
    function IsCorrectValue(Value: Variant): boolean;
    procedure SetDefaultValue;
  protected
    function  GetDisplayName: string; override;
    function GetItemType: TxlsItemType; override;
  public
    constructor Create(Collection: TCollection); override;
    destructor Destroy; override;
    procedure Assign(Source: TPersistent); override;
    procedure SaveToIniFile(IniFile: TQIniFile; const Section: string);
    procedure LoadFromIniFile(IniFile: TQIniFile; const Section: string);

    property IsBoolean: boolean read GetIsBoolean;
    property IsDateTime: boolean read GetIsDateTime;
    property IsNumeric: boolean read GetIsNumeric;
    property IsString: boolean read GetIsString;
  published
    property CellType: TxlsCellType read FCellType
      write FCellType default ctString;
    property Col: word read FCol write FCol;
    property DateTimeFormat: string read FDateTimeFormat
      write FDateTimeFormat;
    property Format: TxlsFormat read FFormat write SetFormat;
    property NumericFormat: string read FNumericFormat
      write FNumericFormat;
    property Row: word read FRow write FRow;
    property Value: Variant read GetValue write SetValue;
  end;

  TxlsCells = class(TCollection)
  private
    FHolder: TPersistent;
  protected
    function GetOwner: TPersistent; override;
    function GetItem(Index: integer): TxlsCell;
    procedure SetItem(Index: integer; Value: TxlsCell);
  public
    constructor Create(Holder: TPersistent);
    function Add: TxlsCell;

    property Holder: TPersistent read FHolder;
    property Items[Index: integer]: TxlsCell read GetItem
      write SetItem; default;
  end;

  TxlsMergedCells = class(TxlsCustomItem)
  private
    FFirstCol: word;
    FFirstRow: word;
    FLastCol: word;
    FLastRow: word;
    function IsCorrect: boolean;
  protected
    function  GetDisplayName: string; override;
    function GetItemType: TxlsItemType; override;
  public
    constructor Create(Collection: Tcollection); override;
    procedure Assign(Source: TPersistent); override;
    procedure SaveToIniFile(IniFile: TQIniFile; const Section: string);
    procedure LoadFromIniFile(IniFile: TQIniFile; const Section: string);
  published
    property FirstCol: word read FFirstCol write FFirstCol;
    property FirstRow: word read FFirstRow write FFirstRow;
    property LastCol: word read FLastCol write FLastCol;
    property LastRow: word read FLastRow write FLastRow;
  end;

  TxlsMergedCellList = class(TCollection)
  private
    FHolder: TPersistent;
  protected
    function GetOwner: TPersistent; override;
    function GetItem(Index: integer): TxlsMergedCells;
    procedure SetItem(Index: integer; Value: TxlsMergedCells);
  public
    constructor Create(Holder: TPersistent);
    function Add: TxlsMergedCells;

    property Holder: TPersistent read FHolder;
    property Items[Index: integer]: TxlsMergedCells read GetItem
      write SetItem; default;
  end;

  TXLSOptions = class(TPersistent)
  private
    FPageFooter: WideString;
    FPageHeader: WideString;
    FSheetTitle: string;

    FHeaderFormat: TxlsFormat;
    FCaptionsFormat: TxlsFormat;
    FDataFormat: TxlsFormat;
    FAggregateFormat: TxlsFormat;
    FFooterFormat: TxlsFormat;
    FHyperlinkFormat: TxlsFormat;
    FNoteFormat: TxlsNoteFormat;

    procedure SetHeaderFormat(const Value: TxlsFormat);
    procedure SetCaptionsFormat(const Value: TxlsFormat);
    procedure SetDataFormat(const Value: TxlsFormat);
    procedure SetAggregateFormat(const Value: TxlsFormat);
    procedure SetFooterFormat(const Value: TxlsFormat);
    procedure SetHyperlinkFormat(const Value: TxlsFormat);
    procedure SetNoteFormat(const Value: TxlsNoteFormat);

    procedure SetSheetTitle(const Value: string);
  public
    constructor Create;
    destructor Destroy; override;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -