I'm currently converting my code and templates from the old FlexCel VCL v3.6 to the current v7.23. A lot of things changed since then, but fortunately my reports are quite simple and a lot of templates only required minor adjustments.
All reports are based on exporting datasets with templates.
Ironically I'm having problems with the more generic ones, where a full dataset needs to be exported.
In v3.6 I have for example a template like this:
Here a table called "memRexExp" would be exported as is, with field titles in the first row and data on the subsequent rows.
However, I know that the third column must always be highlighted in green and the fifth must be formatted as a number with 2 decimal places (you can't see this from the screenshot, but the current selected cell has such a formatting).
This works great in v3.6, as you can see here:
In v7.23 I had to change the template in order to have both titles and data exported (BTW I've also added autowidth feature, which is great!):
However, the exported document doesn't have my formatting anymore:
As you can see, the third column isn't green and the fifth column doesn't have decimals.
I read the docs and understood that this is probably the current behavior by design (all the cells will be overwritten with exported data). So, how can I mimic v3.6 behavior in v7.23?
Look at how "Order Date" has a long date (formatted in spanish here because that's the locale where I run this), different from say Ship Date which has normal formatting.
Note also that we compare table.** to "OrderDate", this means the column name must be "OrderDate" (because 2 * mean column name)
The other one compares table.*to BONAP, and a single * means content, not column name. So this will be blue only if a cell has the "BONAP" text inside. (as is the case if you scroll down below):
Unfortunately I can't change the report to a non-generic one, at least I think I can't. I have quite a lot of datasets in which the first columns are identical and here is where I want to apply a common formatting, but the rest of the columns can vary quite a lot, both in quantity and in content types.
I'm ok with the default formatting of that "extra" columns and this is primarily the reason I'd like to use a single generic template, it'll save me a lot of effort not having to create a specific template for each table. However, some of the common starting columns must be formatted in a specific way, so I need this feature.
I think the field name could be a solution, I have to check but quite certainly the common fields' names are the same.
Is it possible, in case I can't use the field name, to apply format based on column number?