Frequently Asked Component Specific Questions
Options |
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>
TAdvStringGrid
Inserting grid data into an existing sheet in an existing XLS file with TAdvGridExcelIO
Inserting grid data into an existing sheet in an existing XLS file with TAdvGridExcelIO
The last parameter of the XLSExport() call determines what do with the grid data during export to an existing XLS file in an existing sheet. Default, the value is InsertInSheet_InsertClear, meaning it will clear the sheet first before exporting the grid data. If the value is set to: InsertInSheet_InsertRows, it will insert the number of rows in the existing sheet needed for the grid data.
Sample:
begin AdvStringGrid1.RandomFill(false); AdvGridExcelio1.AdvStringGrid := AdvStringGrid1; AdvGridExcelio1.Options.ExportOverwrite := omNever; AdvGridExcelio1.XLSExport('c:\my documents\myexcel.xls','MYSHEET',-1,1,InsertInSheet_InsertRows); end;