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 = ''): boolean; |
 |
function SaveCloseFile(CloseApp, SaveFile: boolean; const SaveFileName: string = ''; FileFormat: integer = 0): boolean; |
 |
procedure SetVisibility(Visible: boolean); |
 |
function GetSheetsCount: integer; |
 |
function SelectSheet(NewSheet: boolean; const SheetName: string = ''; SheetIndex: integer = 0): boolean; |
 |
function DeleteSheet(AllUnselected: boolean; const SheetName: string = ''): boolean; |
 |
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 SetDataSize(RowCount, ColCount: integer); |
 |
function CopyCellsToData: boolean; |
 |
function CopyCellsToClipboard: boolean; |
 |
function CopyUsedRangeToData: boolean; |
 |
function CopyUsedRangeToClipboard: 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); |
 |
procedure FormatCells(Row, Col, RowCount, ColCount: integer; const NumberFormat: string; const FontName: string = ''; FontSize: integer = 0; Frm: TXLSCellFormats = [cfNone]); |
 |
procedure SetPageZoom(Zoom: integer; FitToPagesTall: integer = 1; FitToPagesWide: integer = 1; Orientation: byte = 0); |
 |
procedure SetWindowZoom(Zoom: integer); |
 |
function ExportDBTable(DBGrid: TDBGrid; AutoCloseApp: boolean = true; const ExportToSheetName: string = ''): boolean; overload; |
 |
function ExportDBTable(DataSet: TDataSet; AutoCloseApp: boolean = true; const ExportToSheetName: string = ''): boolean; overload; |
Properties
 |
property DataRowCount: integer read FDataRowCount; |
 |
property DataColCount: integer read FDataColCount; |
 |
property App: OleVariant read FApp; |
 |
property AppOpened: boolean read FAppOpened; |
 |
property Workbook: OleVariant read FWorkbook; |
 |
property Worksheet: OleVariant read FWorksheet; |
 |
property StartRow: integer read FStartRow write SetStartRow default 1; |
 |
property StartCol: integer read FStartCol write SetStartCol default 1; |
 |
property ExportFile: string read FExportFile write FExportFile; |
 |
property SetFontName: string read FSetFontName write FSetFontName; |
 |
property SetFontSize: integer read FSetFontSize write FSetFontSize default 0; |
 |
property DefaultDateFormat: string read FDefaultDateFormat write FDefaultDateFormat; |
 |
property DefaultTimeFormat: string read FDefaultTimeFormat write FDefaultTimeFormat; |
 |
property DefaultNumFormat: string read FDefaultNumFormat write FDefaultNumFormat; |
 |
property MaxColWidth: integer read FMaxColWidth write FMaxColWidth default 100; |
 |
property PageZoom: integer read FPageZoom write FPageZoom default 0; |
 |
property WindowZoom: integer read FWindowZoom write FWindowZoom default 0; |
 |
property Options: TXLSExportOptions read FOptions write FOptions default[xleExportTitles, xleBoldTitles, xleOnlyVisibleFields, xleAddSumRow,
xleSetCellFormat, xleSetColumnWidth]; |
 |
property ActionAfter: TActionAfter read FActionAfter write FActionAfter default aaShow; |
 |
property OnBeforeExport: TNotifyEvent read FOnBeforeExport write FOnBeforeExport; |
 |
property OnAfterExport: TNotifyEvent read FOnAfterExport write FOnAfterExport; |
 |
property ShowProgressBar: boolean read FShowProgressBar write FShowProgressBar default false; |
 |
property OnProgressEvent: TProgressEvent read FOnProgressEvent write FOnProgressEvent; |
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 = ''): 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 SetVisibility(Visible: boolean); |
set visibility of Excel application
|
 |
function GetSheetsCount: integer; |
|
 |
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 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 SetDataSize(RowCount, ColCount: integer); |
prepare Data array according RowCount and ColCount
|
 |
function CopyCellsToData: boolean; |
read values from cells to Data array, StartRow and StartCol + DataRowCount and DataColCount is used to define source range
|
 |
function CopyCellsToClipboard: boolean; |
copy values from cells to Clipboard, StartRow and StartCol + DataRowCount and DataColCount is used to define source range
|
 |
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 PasteDataToCells(SetAutoFilter: boolean = false): boolean; |
write values from Data array to cells, StartRow and StartCol + DataRowCount and DataColCount is used to define target range
|
 |
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); |
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 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: TDBGrid; 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)
|
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 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 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 Options: TXLSExportOptions read FOptions write FOptions default[xleExportTitles, xleBoldTitles, xleOnlyVisibleFields, xleAddSumRow,
xleSetCellFormat, xleSetColumnWidth]; |
Defines options for ExportDBTable function
|
 |
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 ShowProgressBar: boolean read FShowProgressBar write FShowProgressBar default false; |
indicate whether progress bar is shown
|
 |
property OnProgressEvent: TProgressEvent read FOnProgressEvent write FOnProgressEvent; |
Defines event used periodically during exporting of data
|
Generated by PasDoc 0.13.0 on 2016-02-19 08:14:11
|