Forum > FPSpreadsheet
Open xls and fill it
(1/1)
mirce.vladimirov:
I'm using existing excel file (excel8) and filling it with freshly collected data from my aplication.
--- Code: ---
EkselFile:=TsWorkbook.Create;
EkselFile.ReadFromFile('my_excell_file.xls');
MyWorksheet := EkselFajl.GetWorksheetByIndex(0); // use the first worksheet
--- End code ---
The existing file is using formulas to calculate procents and totals, it's formated, colored, bordered, bolded, underlined... so I'm using it and just put newly calculated data into it and then I save it:
--- Code: --- EkselFile.WriteToFile('the_new_file.xls', sfExcel8, true);
ekselFile.Free;
--- End code ---
When I open the file i can see Data that i put on is correct while previous formating is lost, only the text of the headlines of columns and rows are kept but
- no more color,
- no bold fonts,
- fonts size set to default size,
- fonts all set to default font, and
- no more formula.
What am i missing ?
Mike.Cornflake:
http://wiki.freepascal.org/FPSpreadsheet#Support_by_file_format
Looks like only RPN formula's are supported in Excel 8 at the moment...
No idea about the formatting...
felipemdc:
Every feature needs to be supported in both the reader and the writer for this to work. And not all features are currently supported, so those that are unsupported get dropped.
Navigation
[0] Message Index