View Issue Details

IDProjectCategoryView StatusLast Update
0014466Lazarus CCR-public2011-12-01 07:29
ReporterTorsten Bonde Christiansen Assigned ToFelipe Monteiro de Carvalho  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Summary0014466: FPSpreadSheet - Autodetect file format.
DescriptionI would like to request an autodetect feature for the FPSpreadSheet packages.

Currently when using the TsWorkBook.ReadFrom[File|Stream] procedure, it is required that your specify the format. It would be a great help if the TsWorkBook supported some sort of autodetect function, which only take the filename open the file based on the format of the file.
TagsNo tags attached.
Widgetset
Attached Files

Activities

Felipe Monteiro de Carvalho

2009-09-02 17:23

developer   ~0030335

Could you propose an algorithm to do that?

BIFF2 has a marker, so that should be trivial to detect. Now BIFF5 and BIFF8 are OLE documents, and while we can detect if it's an OLE document, it's harder to detect if it's either BIFF5 or BIFF8. The other formats are even harder, because they are zipped and trying to unzip something without knowing it is zip might bring all kinds of errors.

Torsten Bonde Christiansen

2009-09-03 07:25

reporter   ~0030354

Not at the moment no. I am not at all into how the file formats of BIFF's and .ODS's are constructed.

If i get the time I'll have a look at the specifications and perhaps see if I can device and algorithm.

Felipe Monteiro de Carvalho

2011-05-25 13:53

developer   ~0048577

I added a ReadFromFile function which will try to guess the format from the extension in rev 1642

In case of .xls it will assume Excel 8.

Issue History

Date Modified Username Field Change
2009-08-31 08:14 Torsten Bonde Christiansen New Issue
2009-08-31 08:30 Vincent Snijders LazTarget => -
2009-08-31 08:30 Vincent Snijders Assigned To => Felipe Monteiro de Carvalho
2009-08-31 08:30 Vincent Snijders Status new => assigned
2009-09-02 17:23 Felipe Monteiro de Carvalho Note Added: 0030335
2009-09-03 07:25 Torsten Bonde Christiansen Note Added: 0030354
2009-09-03 17:52 Vincent Snijders Project Packages => Lazarus CCR
2011-05-25 13:53 Felipe Monteiro de Carvalho Status assigned => resolved
2011-05-25 13:53 Felipe Monteiro de Carvalho Resolution open => fixed
2011-05-25 13:53 Felipe Monteiro de Carvalho Note Added: 0048577
2011-12-01 07:29 Torsten Bonde Christiansen Status resolved => closed