Rosi ComponentsUnits Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Class TrXLSExport
Unit
rXLSExport
Declaration
type TrXLSExport = class(TComponent)
Description
non visual component which provides functionality for exporting of any data directly to XLS file using OLE
Hierarchy
Overview
Fields
Methods
|
function IsAppExist: boolean; |
|
function OpenFile(NewFile: boolean; const OpenFileName: string = ''; CanReadOnly: boolean = true): boolean; |
|
function SaveCloseFile(CloseApp, SaveFile: boolean; const SaveFileName: string = ''; FileFormat: integer = 0): boolean; |
|
procedure Disconnect; |
|
procedure SetVisibility(Visible: boolean); |
|
function GetShortDateFormat: string; |
|
function ConvertDateFormat(FieldDateFormat: string): string; |
|
function GetSheetsCount: integer; |
|
function SelectSheet(NewSheet: boolean; const SheetName: string = ''; SheetIndex: integer = 0): boolean; |
|
function DeleteSheet(AllUnselected: boolean; const SheetName: string = ''): boolean; |
|
procedure RememberActiveSheet; |
|
procedure SelectRememberSheet; |
|
function ActivateRangeSheet(var RangeName: string): boolean; |
|
procedure SetCurrentRange(Row, Col, RowCount, ColCount: integer); |
|
procedure SetStartPos(ClearExistingRows: boolean = true; AddToExistingRows: boolean = false); |
|
function GetCellValue(Row, Col: integer): Variant; |
|
procedure SetCellValue(Row, Col: integer; Value: Variant; const NumberFormat: string = ''); |
|
procedure SetRangeValue(RangeName: string; Value: Variant; const NumberFormat: string = ''); |
|
procedure SetDataSizeFromRange(RangeName: string); |
|
procedure SetDataSize(RowCount, ColCount: integer); |
|
function CopyCellsToData: boolean; |
|
function CopyCellsToClipboard: boolean; |
|
function CopyUsedRangeToData: boolean; |
|
function CopyUsedRangeToClipboard: boolean; |
|
function CopyCurrentRegionToData: boolean; |
|
function CopyCurrentRegionToClipboard: boolean; |
|
function PasteDataToCells(SetAutoFilter: boolean = false): boolean; |
|
function PasteClipboardToCells(SetAutoFilter: boolean = false): boolean; |
|
procedure FreezePanes(Row, Col: integer); |
|
procedure SetColumnWidth(Col: integer; ColWidth: integer); |
|
procedure SetRowHeight(Row: integer; RowHeight: integer); |
|
procedure ColumnAutoFit(Col: integer; MaxColWidth: integer); |
|
procedure RowAutoFit(Row: integer; MaxRowHeight: integer); |
|
procedure UsedRangeAutoFit(MaxColWidth: integer = 0; MaxRowHeight: integer = 0; SetColumnWidth: boolean = true; SetRowHeight: boolean = true); |
|
procedure FormatCells(Row, Col, RowCount, ColCount: integer; const NumberFormat: string; const FontName: string = ''; FontSize: integer = 0; Frm: TXLSCellFormats = [cfNone]); |
|
procedure BorderCells(Row, Col, RowCount, ColCount: integer; Border: integer = xlAllBorders; LineColor: TColor = clNone; LineWidth: integer = xlThin; LineStyle: integer = xlContinuous); |
|
procedure DatabarCells(Row, Col, RowCount, ColCount: integer; DatabarSetting: TDatabarSetting); |
|
procedure ColorScaleCells(Row, Col, RowCount, ColCount: integer; ColorScaleSetting: TColorScaleSetting); |
|
procedure IconSetCells(Row, Col, RowCount, ColCount: integer; IconSetSetting: TIconSetSetting); |
|
procedure SetPageZoom(Zoom: integer; FitToPagesTall: integer = 1; FitToPagesWide: integer = 1; Orientation: byte = 0); |
|
procedure SetWindowZoom(Zoom: integer); |
|
function ExportDBTable(DBGrid: TCustomDBGrid; AutoCloseApp: boolean = true; const ExportToSheetName: string = ''): boolean; overload; |
|
function ExportDBTable(Dataset: TDataSet; AutoCloseApp: boolean = true; const ExportToSheetName: string = ''): boolean; overload; |
|
function ExportDBTable(rDBRecView: TrDBRecView; AutoCloseApp: boolean = true; const ExportToSheetName: string = ''): boolean; overload; |
|
function ExportDBTable(TreeView: TCustomTreeView; AutoCloseApp: boolean = true; const ExportToSheetName: string = ''): boolean; overload; |
|
function ExportDBTable(rStringGridEd: TrStringGridEd; AutoCloseApp: boolean = true; const ExportToSheetName: string = ''): boolean; overload; |
Properties
Description
Fields
|
Data: Variant; |
Data array contain data which was read from cells or which should be stored to cells
|
Methods
|
function IsAppExist: boolean; |
test if Excel App is available
|
|
function OpenFile(NewFile: boolean; const OpenFileName: string = ''; CanReadOnly: boolean = true): boolean; |
run Excel and open new or existing file
|
|
function SaveCloseFile(CloseApp, SaveFile: boolean; const SaveFileName: string = ''; FileFormat: integer = 0): boolean; |
close Excel and optionally save file
|
|
procedure Disconnect; |
Disconnect from current excel application, Excel keep opened
|
|
procedure SetVisibility(Visible: boolean); |
set visibility of Excel application
|
|
function GetShortDateFormat: string; |
return local NumericFormat string for short date in Excel
|
|
function ConvertDateFormat(FieldDateFormat: string): string; |
return local NumericFormat string for short date in Excel
|
|
function GetSheetsCount: integer; |
return number of sheets
|
|
function SelectSheet(NewSheet: boolean; const SheetName: string = ''; SheetIndex: integer = 0): boolean; |
add new sheet and set its name or select active sheet according SheetName
|
|
function DeleteSheet(AllUnselected: boolean; const SheetName: string = ''): boolean; |
delete all unselected sheets or delete one sheet according SheetName
|
|
procedure RememberActiveSheet; |
remember actual active sheet
|
|
procedure SelectRememberSheet; |
select active sheet after open or after call RememberActiveSheet
|
|
function ActivateRangeSheet(var RangeName: string): boolean; |
select sheet by name defined in range name and return range name without sheet: sheet!range
|
|
procedure SetCurrentRange(Row, Col, RowCount, ColCount: integer); |
set Range object
|
|
procedure SetStartPos(ClearExistingRows: boolean = true; AddToExistingRows: boolean = false); |
set starting row for export, select first empty row if AddToExisting is true
|
|
function GetCellValue(Row, Col: integer): Variant; |
return value of one cell
|
|
procedure SetCellValue(Row, Col: integer; Value: Variant; const NumberFormat: string = ''); |
set value of one cell
|
|
procedure SetRangeValue(RangeName: string; Value: Variant; const NumberFormat: string = ''); |
set value of RangeName
|
|
procedure SetDataSizeFromRange(RangeName: string); |
prepare Data array according RangeName size
|
|
procedure SetDataSize(RowCount, ColCount: integer); |
prepare Data array according RowCount and ColCount
|
|
function CopyUsedRangeToData: boolean; |
read values from UsedRange of selected Sheet to Data array, size is set according UsedRange
|
|
function CopyUsedRangeToClipboard: boolean; |
read values from UsedRange of selected Sheet to Clipboard
|
|
function CopyCurrentRegionToData: boolean; |
read values from UsedRange of selected Sheet to Data array, size is set according UsedRange
|
|
function CopyCurrentRegionToClipboard: boolean; |
read values from UsedRange of selected Sheet to Clipboard
|
|
function PasteClipboardToCells(SetAutoFilter: boolean = false): boolean; |
paste values from Clipboard to cells, StartRow and StartCol is used to define target range
|
|
procedure FreezePanes(Row, Col: integer); |
switch on FreezePanes in selected sheet, if Row and Col is 0 FreezePanes is switched off
|
|
procedure SetColumnWidth(Col: integer; ColWidth: integer); |
set width of one column
|
|
procedure SetRowHeight(Row: integer; RowHeight: integer); |
set height of one row
|
|
procedure ColumnAutoFit(Col: integer; MaxColWidth: integer); |
set automatic width of one column
|
|
procedure RowAutoFit(Row: integer; MaxRowHeight: integer); |
set automatic height of one row
|
|
procedure UsedRangeAutoFit(MaxColWidth: integer = 0; MaxRowHeight: integer = 0; SetColumnWidth: boolean = true; SetRowHeight: boolean = true); |
set automatic width of all columns and rows in selected sheet
|
|
procedure FormatCells(Row, Col, RowCount, ColCount: integer; const NumberFormat: string; const FontName: string = ''; FontSize: integer = 0; Frm: TXLSCellFormats = [cfNone]); |
set Number format and/or Font for cells in square defined by Row/Col/Count
|
|
procedure BorderCells(Row, Col, RowCount, ColCount: integer; Border: integer = xlAllBorders; LineColor: TColor = clNone; LineWidth: integer = xlThin; LineStyle: integer = xlContinuous); |
set Number format and/or Font for cells in square defined by Row/Col/Count
|
|
procedure DatabarCells(Row, Col, RowCount, ColCount: integer; DatabarSetting: TDatabarSetting); |
set condition format as Databar for cells in square defined by Row/Col/Count
|
|
procedure ColorScaleCells(Row, Col, RowCount, ColCount: integer; ColorScaleSetting: TColorScaleSetting); |
set condition format as ColorScale for cells in square defined by Row/Col/Count
|
|
procedure IconSetCells(Row, Col, RowCount, ColCount: integer; IconSetSetting: TIconSetSetting); |
set condition format as IconSet for cells in square defined by Row/Col/Count
|
|
procedure SetPageZoom(Zoom: integer; FitToPagesTall: integer = 1; FitToPagesWide: integer = 1; Orientation: byte = 0); |
set page zoom or number of pages for printout
|
|
procedure SetWindowZoom(Zoom: integer); |
set window zoom
|
|
function ExportDBTable(DBGrid: TCustomDBGrid; AutoCloseApp: boolean = true; const ExportToSheetName: string = ''): boolean; overload; |
execute creating export for DBGrid (columns collection is used)
|
|
function ExportDBTable(Dataset: TDataSet; AutoCloseApp: boolean = true; const ExportToSheetName: string = ''): boolean; overload; |
execute creating export for Dataset (fields collection is used)
|
|
function ExportDBTable(rDBRecView: TrDBRecView; AutoCloseApp: boolean = true; const ExportToSheetName: string = ''): boolean; overload; |
execute creating export for one record from rDBRecView (rows/fields collection is used)
|
|
function ExportDBTable(TreeView: TCustomTreeView; AutoCloseApp: boolean = true; const ExportToSheetName: string = ''): boolean; overload; |
execute creating export for TreeView (Items collection is used)
|
|
function ExportDBTable(rStringGridEd: TrStringGridEd; AutoCloseApp: boolean = true; const ExportToSheetName: string = ''): boolean; overload; |
execute creating export for rStringGrid (columns and rows collection is used)
|
Properties
|
property DataRowCount: integer read FDataRowCount; |
indicate size of Data array
|
|
property DataColCount: integer read FDataColCount; |
indicate size of Data array
|
|
property App: OleVariant read FApp; |
return Excel application OLE object
|
|
property AppOpened: boolean read FAppOpened; |
indicate whether excel app is opened by component
|
|
property Workbook: OleVariant read FWorkbook; |
return active Workbook OLE object
|
|
property Worksheet: OleVariant read FWorksheet; |
return active Worksheet OLE object
|
|
property Range: OleVariant read FRange; |
return current Range OLE object
|
|
property ExportStructureOnly: boolean read FExportStructureOnly write FExportStructureOnly; |
define that only structure (name of fields) will be exported
|
|
property ColWidthPixelRatio: double read FColWidthPixelRatio write FColWidthPixelRatio; |
define pixels to column width ratio
|
|
property RowHeightPixelRatio: double read FRowHeightPixelRatio write FRowHeightPixelRatio; |
define pixels to row height ratio
|
|
property StartRow: integer read FStartRow write SetStartRow default 1; |
Defines first row for export
|
|
property StartCol: integer read FStartCol write SetStartCol default 1; |
Defines first collumn for export
|
|
property ExportFile: string read FExportFile write FExportFile; |
Defines output file name, if missing new file is opened
|
|
property SetFontName: string read FSetFontName write FSetFontName; |
Defines FontName which will be set in output file
|
|
property SetFontSize: integer read FSetFontSize write FSetFontSize default 0; |
Defines FontSize which will be set in output file
|
|
property DefaultDateFormat: string read FDefaultDateFormat write FDefaultDateFormat; |
Defines default format for date fields
|
|
property DefaultTimeFormat: string read FDefaultTimeFormat write FDefaultTimeFormat; |
Defines default format for time fields
|
|
property DefaultNumFormat: string read FDefaultNumFormat write FDefaultNumFormat; |
Defines default format for numeric fields
|
|
property MaxColWidth: integer read FMaxColWidth write FMaxColWidth default 100; |
Defines maximal width of columns after AutoFit
|
|
property MaxRowHeight: integer read FMaxRowHeight write FMaxRowHeight default 30; |
Defines maximal height of rows after AutoFit
|
|
property VerticalAlignment: TXLSVerticalAlignment read FVerticalAlignment write FVerticalAlignment default vaNone; |
Defines vertical alignment of all rows
|
|
property PageZoom: integer read FPageZoom write FPageZoom default 0; |
Defines standard page zoom
|
|
property WindowZoom: integer read FWindowZoom write FWindowZoom default 0; |
Defines standard window zoom
|
|
property PictureMaxWidth: integer read FPictureMaxWidth write FPictureMaxWidth default 200; |
Defines maximal width of the picture, bigger picture will be resized
|
|
property PictureMaxHeight: integer read FPictureMaxHeight write FPictureMaxHeight default 200; |
Defines maximal height of the picture, bigger picture will be resized
|
|
property PictureCellMargin: integer read FPictureCellMargin write FPictureCellMargin default 5; |
Defines margin around the picture in the cell
|
|
property PictureUseShadow: boolean read FPictureUseShadow write FPictureUseShadow default false; |
Defines usage of shadow around the picture in the cell
|
|
property OptionColors: TXLSExportColors read FOptionColors write FOptionColors default[]; |
|
|
property ActionAfter: TActionAfter read FActionAfter write FActionAfter default aaShow; |
Defines action after exporting (None, Show, Print)
|
|
property OnBeforeExport: TNotifyEvent read FOnBeforeExport write FOnBeforeExport; |
Defines event for user defined action
|
|
property OnAfterExport: TNotifyEvent read FOnAfterExport write FOnAfterExport; |
Defines event for user defined action
|
|
property UseDisableControl: boolean read FUseDisableControl write FUseDisableControl default true; |
indicate whether DisableControls is used during dataset scan
|
|
property ShowProgressBar: boolean read FShowProgressBar write FShowProgressBar default false; |
indicate whether progress bar is shown
|
|
property GetFieldType: TGetFieldType read FGetFieldType write FGetFieldType; |
Defines events for custom specification of field type (used for exporting of Pictures, Colors, databar, ColorScales
|
|
property OnProgressEvent: TProgressEvent read FOnProgressEvent write FOnProgressEvent; |
Defines event used periodically during exporting of data
|
|
property OnPreparePictureEvent: TPreparePictureEvent read FOnPreparePictureEvent write FOnPreparePictureEvent; |
Defines event for custom preparation of the picture before exporting
|
|
property OnPrepareDatabarEvent: TPrepareDatabarEvent read FOnPrepareDatabarEvent write FOnPrepareDatabarEvent; |
Defines event for custom preparation of the databar format before exporting
|
|
property OnPrepareColorScaleEvent: TPrepareColorScaleEvent read FOnPrepareColorScaleEvent write FOnPrepareColorScaleEvent; |
Defines event for custom preparation of the ColorScale format before exporting
|
|
property OnPrepareIconSetEvent: TPrepareIconSetEvent read FOnPrepareIconSetEvent write FOnPrepareIconSetEvent; |
Defines event for custom preparation of the IconSet format before exporting
|
Generated by PasDoc 0.15.0.
|