[Lazarus] [ANN] FPSpreadsheet date support - success story

Reinier Olislagers reinierolislagers at gmail.com
Wed Nov 27 09:43:26 CET 2013


Hi all,

I've looked into adding date/time support for BIFF8/XLS and seem to have
it working.
As long as I'm busy with fpspreadsheet, I'm incorporating some other
fixes I had going and added an FPCUnit test suite to check against
regressions.

When I've got the tests extended some more and have gone through all the
changes again, I'll upload it to mantis for the fpspreadsheet devs to
have a look and hopefully include it.

Meanwhile, you can try it out for yourself:
https://bitbucket.org/reiniero/smalltools/downloads/fpspreadsheet_27November.zip

As usual, comments and code suggestions welcome.

Thanks,
Reinier

My work-in-progress notes:
- Added FPCUnit test suite to test reading and reading writing files.
For now uses BIFF8 xls; contributions for other formats and more tests
welcome. See the tests subdirectory.
- XLS BIFF8: added DATE and TIME worksheet functions to RPN formula
- Allow writing formula,*<check others, cardinal changes> fields for
formats that support it.
Note: changes public signature from word to cardinal=> check: this
shouldn't impact existing code, should it? Anyway, the same change was
done for the label/text cell support earlier
- Add date/time/datetime read/write support for BIFF8 xls format. No
plans for earlier formats though the code could be adapted
- Add checks for text cell size limits when writing xls, xml. If
exceeded, cell text will be truncated and an exception will be raised
you can use try..except to discard this exception in your application if
wanted
- Formats that use zip have extra checks to prevent crashes for invalid
zip dates
- Use FPC built-in zip format when using FPC 2.7.1+ as it has
fixes/improvements (e.g. zip64 support)




More information about the Lazarus mailing list