Importing data from Excel.

Here you can read all the values from an Excel worksheet, modify them, and save them back. As this demo could be useful by itself, I created a TFlexCelGrid component that encapsulates it. So, to study the source code you’ll have to read TFlexCelImport source. Also, be sure to see the XlsViewer app.

For speed reasons, FlexCelGrid won’t run on OLE mode, so you will have to use Native for this. FlexCelImport does run in ole mode.

Concepts shown:
•	Using a Native Adapter: Usually, you will want to use a native adapter to read the data, but if you are trying to read an older file (Excel 95 or earlier), you will have to use OLE.

•	Creating an Excel file manually:  If you don't want/ can’t use the FlexCelReport component to create a report, FlexCelImport gives you a primitive API for writing values directly. I would recommend you to not abuse this feature, and use a FlexCelReport component always that you can, but that's just me. If you use code to write to excel, your code might not as portable as it would if you had used a template.

•	 Row AutoFit: By default, rows in Excel adapt to the font size. If you assign a row height manually, the autofit is lost. We take care of not modifying row heights unless the user really has selected that, by using the RowAutoHeight property of FlexCel import.

•	Images: Excel saves images on 6 formats: JPEG, BMP, WMF, EMF, PICT and PNG. By default, TFlexCelGrid reads JPEG and BMP images. For it to display PNG’s or any other, you have to assign its OnFormatPicture event, or uncomment the UsePngLib directive. See the doc for more info.