PRODUCTS

FEATURED PRODUCT

Time & money saving bundle of over 500 components for Windows & IntraWeb application development!

License only 395 EUR See More

SEARCH

LOGIN

Customer login to access products, support information & special benefits.

NEWS ALERTS

Add your e-mail address here to receive the monthly TMS Software alerts.

 

LINKS

EXAMPLE 59

TAdvStringGrid

example 59 : using TAdvGridWorkbook with TAdvGridExcelIO to load/save multi sheet XLS files

The new TAdvGridExcelIO component is TAdvGridWorkbook aware, making an almost codeless solution possible to load and save multisheet XLS files.

TAdvGridExcelIO has now 2 properties: AdvGridWorkbook : assign a TAdvGridWorkbook to this property if you want to use it with a workbook. AdvStringGrid : assign a TAdvStringGrid to this property if you want to use it with just one grid.

To load the default sheet from an XLS file in a workbook or grid, use:

AdvGridExcelIO.XLSImport(filename,1);

To load all sheets from an XLS file in a workbook, use:

AdvGridExcelIO.XLSImport(filename);

Similary, to export one sheet from TAdvStringGrid or TAdvGridWorkbook (the active sheet in this case) use:

AdvGridExcelIO.XLSExport(filename, sheetname);

To export all sheets of a TAdvGridWorkbook to an XLS file use:

AdvGridExcelIO.XLSExport(filename);


Delphi project & source files for downloading included in the main demos distribution for Delphi.

The project and source files have been written with Delphi 6,7. To use these files in other versions of Delphi, ignore any remarks when opening the form files and save the files. After this, compilation can be done. The error messages are due to properties included in the Delphi 6 form file, but not available in lower versions of Delphi.  

Copyright © 1995 - 2008 TMS Software