After seeing the demos, you might have an idea of what FlexCel can do. What maybe is not so clear is what it can’t do, and why some apparently “obvious” features are left away. Maybe is not a usual practice to speak about your own product’s limitations, but I wanted to be as sincere as possible. So I wanted to speak a little about the philosophy I used when creating this.

First of all, FlexCel is intended to be a Report Generator, not a native implementation of the OLE API. Even when I will go adding commands to the API (FlexCel Import), using it should be for rare situations, and I don’t want it to become the general way to create a file.

The thing that mostly confuses users is the way TFlexCelReport works. It’s not you that tell FlexCel where you want to put your data, but FlexCel that asks you what data you want. Think of it as an event-driven approach opposed to a procedural approach.

You have to look at it as 3 layers:

 O----------------O    O-----------------O    O--------------------O
 |   Data Layer   |    | Interface Layer |    | Presentation Layer |
 |    (Delphi)    |    |    (FlexCel)    |    |      (Excel)       |
 |                |    |                 |    |                    |
 O----------------O    O-----------------O    O--------------------O

FlexCel’s mission is to transport the data from the data layer to the presentation. It’s optimized for this, and that’s all it’s designed to do.  

Before you transport the data you have to transform it accordingly, and for this you should use standard Delphi. If you want to sort your data, sort the dataset. If you want to filter records, filter the dataset, or even better, create a good SQL statement.  If you want to add calculated fields, add them to the dataset. And if your data is so complex you can’t organize this way (or you are not using DB’s), you can always fill a TFlxMemTable with the desired values. 

Once the data is on the format you want, you have to create the presentation layer. There you define what data you want (by defining named ranges and ## fields) and how you want to display it (by using formats and conditional formats)

Once you have the data and presentation ready, and only then, you call FlexCel to pass it from one to the other. You won’t be telling FlexCel what to do, is the Presentation layer that will ask the Data layer for data when it needs it.

I try to avoid as much as I can the “feature blow”, that is, I want to keep FlexCel interface as simple as possible (but not less). You won’t find commands to sort/group/etc the data in FlexCel, because this is a job for the data layer.  You won’t find commands to format the data, because this is a job for the presentation layer.

My idea is, try to make all the hard work at Excel and at Standard Delphi. Most of the times, the only thing you have to write at the interface layer is a “FlexCel.Run”. If tomorrow you want to use another solution and not FlexCel, transition will be much easier than if you had written tons of code of the type “Flexcel.Cells[3,4].format.font.name=’Arial’” etc. And let’s not talk about when your user wants to insert a column on an existing report… remember, your user will always want to insert a column… If you have a good template, it can take seconds. If you have a mess of code, it will not be.

And that was all. If you kept reading up to here ….but wait…no, you didn’t! You scrolled all the text from the top, didn’t you?

Anyway, have fun. Kind Regards,
   Adrian.