porting from older Flexcel to new API

The Flexcel API in 5.0 seems to be drastically changed. What is the best way to port an application that uses a lot of older templates and functionality in the older TFlexCelReport(s) API?


While indeed 5.0 is a full rewrite, the API didn't change too much. Some things did change, for example the name of the main class (used to be FlexCelImport which didn't made sense since you could use an "import" component to "export" files, so now it is TExcelFile /TXlsFile). Also properties changed, we don' use indexed properties anymore (because C++ builder had a lot of issues with them), so instead of FlexCelImport.CellValue[row, col] now you have XlsFile.SetCellValue and XlsFile.GetCellValue.

But well, in the API side it shouldn't be difficult, it is a matter mostly of pressing F9 and fixing the syntax errors. Remember also that you can use APIMate (start menu->TMS FlexCel->Tools) to convert an xls file to FlexCel 5 delphi code. So you can open the file you generated with FlexCel 3, and see the code you would need to generate the same file with FlexCel 5.

In the reporting side, the main issue is that we haven't finished FlexCelReports 5 yet, they will be coming soon after we release 5.5. When we release them, they will have some differences with the current ones (for example tags are <#field.db> instead of <##field##db>) but we will be providing a converter to convert between 3.0 and 5.0 reports.

Also remember that you can use the v3 API (FlexCelReport/FlexCelImport) with the v5 Engine. There is a new component in FlexCel 3.6: TXlsxAdapter, that will allow you to keep using the old components with the new engine, supporting xlsx. While not a long term solution, it can help doing the migration, since you can migrate parts and keep using v3 in the others.

So in short:
1) For API (FlexCelImport), I would start migrating the code to TXlsFile. You can keep using FlexCelImport with v5 via TXlsxAdapter, but in my opinion it isn't worth. Migration is simple enough.

2) For reports, you can't migrate yet since we v5 reports aren't ready. So the option here is to wait until they are, and we will have an automatic converter to do the conversion. But same as with FlexCelImport, you can use the v3 reports with TXlsxAdapter to allow FlexCelReport to create xlsx files.

No matter how complex the migration, remember that you can do it step by step, migrating parts and keeping other parts in the v3, there is no need to migrate all at once. And v3 will be supported for a very long time, so there is no rush.

Well, I need the reports in my application. Will the v3 report components you mention work with Delphi XE2 in 32 and 64 bit modes? Also, how soon do you expect to release the 5.5, just to have an idea?

Yes, FlexCel 3.6 (available in the downloads page below FlexCel 5) supports XE2 and both 32 nd 64 bit modes.

5.5 is expected for  next week, but 5.5 will not have reports yet, it will have html/pdf exporting and native printing. After 5.5 is released, next step will be reports, which are actually kind of working here internally, but need a lot of testing still.