I used the following code to create an xls, xlsx and ods file from the same worksheet, based on the elemental fpspreadsheet functions alone (without complications due to the DefaultRowHeight imposed by the worksheet grid):
uses
fpspreadsheet, fpstypes, fpsallformats;
var
wb: TsWorkbook;
ws: TsWorksheet;
begin
wb := TsWorkbook.Create;
try
ws := wb.AddWorksheet('Test');
//ws.WriteDefaultRowHeight(20, suPoints);
ws.WriteNumber(0, 0, 1.23);
ws.WriteNumber(1, 0, 2.34);
ws.WriteNumber(2, 1, 3.45);
wb.WriteToFile('test.xls', sfExcel8, true);
wb.WriteToFile('test.xlsx', sfOOXML, true);
wb.WriteToFile('test.ods', sfOpenDocument, true);
finally
wb.Free;
end;
end.
Opening the xls and xlsx files in Excel and querying the height of an arbitrary row yields the value 15, which is in points - and this is what fpspreadsheet is set up to start with (TsWorksheet.Create: FDefaultRowHeight := ptsToMM(15)). Opening the same files in LibreOffice Calc yields a row height of 0.53 cm, and this is the equivalent of 15 pts. Fine.
But opening the ods file in LibreOffice Calc yields a row height of 0.45 cm (12.75 pts). Even deliberately changing the worksheet's DefaultRowhigh (by activated to commented-out line in the code above) makes no difference. The row style node in the xml file looks like this:
<style:style style:name="ro1" style:family="table-row">
<style:table-row-properties style:row-height="5.292mm" style:use-optimal-row-height="true" fo:break-before="auto" />
</style:style>
"use-optimal-row-height" probably means that the row height will be determined by the font height, no matter which value is specified in the "style:row-height" attribute. In fact, changing "use-optimal-row-height" to false and entering some different value for "style:row-height" yields in different row heights, but only for the rows containing cells with values, not for the empty rows. Probably the style of a non-empty row must be repeated for the following empty rows - this concept with "rows-repeated" in OpenDocument has a detrimental effect on the speed and memory performance of fpspreadsheet which will create more than 1 million row records in reading.
I will definitely not touch this since the "rows-repeated" and "columns-repeated" gave me lots of gray hair already.