Closed svetter closed 10 months ago
Basic FODS file format:
<?xml version="1.0" encoding="UTF-8"?>
<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.spreadsheet">
<office:automatic-styles>
<number:date-style style:name="N49">
<number:year number:style="long"/>
<number:text>-</number:text>
<number:month number:style="long"/>
<number:text>-</number:text>
<number:day number:style="long"/>
</number:date-style>
<number:time-style style:name="N60">
<number:hours number:style="long"/>
<number:text>:</number:text>
<number:minutes number:style="long"/>
</number:time-style>
<style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N49"/>
<style:style style:name="ce2" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N60"/>
</office:automatic-styles>
<office:body>
<office:spreadsheet>
<table:table table:name="Table name">
<table:table-column table:number-columns-repeated="2" table:default-cell-style-name="Default"/>
<table:table-column table:default-cell-style-name="ce1"/>
<table:table-column table:default-cell-style-name="ce2"/>
<table:table-row>
<table:table-cell office:value-type="string">
<text:p>text</text:p>
</table:table-cell>
<table:table-cell office:value-type="float" office:value="42">
<text:p>42</text:p>
</table:table-cell>
<table:table-cell office:value-type="date" office:date-value="2023-11-13">
<text:p>2023-11-13</text:p>
</table:table-cell>
<table:table-cell office:value-type="time" office:time-value="PT12H34M00S">
<text:p>12:34</text:p>
</table:table-cell>
</table:table-row>
</table:table>
</office:spreadsheet>
</office:body>
</office:document>
https://doc.qt.io/qt-6/qxmlstreamwriter.html
QFile file("example.xml");
if (!file.open(QIODevice::WriteOnly)) error();
QXmlStreamWriter xmlWriter(&file);
...
In <office:automatic-styles>
:
<style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default">
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
</style:style>
In <table:table>
for column:
<table:table-column table:style-name="co1" table:default-cell-style-name="ce1"/>
Cell:
<table:table-cell table:style-name="ce1" office:value-type="...">
Implementation for different parameters
Implementation ideas:
enum ColumnExportFlag { NeverExport, AlwaysExport, ExportAsStat, ExportForConsolidated, ExportForConsolidatedAsStat }
to mark which columns should be exported in which modescalculateValueAt()
and pushing the results to export immediately