Hi Dean,
Thank you for the clarification in the thread. In my case, the leading single quote (') is definitely not present in the template cells.
I encountered the core issue you mentioned: even after setting the cell format to "Number" (2 decimal places, thousands separator) in the LibreOffice Calc 25.2.6.2 GUI, the generated XML in content.xml stubbornly remains office:value-type="string" for cells containing placeholders like %(sum_field)s. Manually editing the ODS file at the XML level for every report is not a practical solution for our workflow.
My Implemented Solution:
I modified the print_band method in report.py. The logic now detects numeric fields (by name prefix, e.g., sum_, count_) and during report generation, it directly replaces the cell's opening XML tag. It changes office:value-type="string" to office:value-type="float", adds the office:value attribute with the numeric value, and updates calcext:value-type accordingly. All original cell styling (table:style-name) is preserved.
This approach works reliably in production, ensuring numbers are recognized as such in the final ODS/Excel file while keeping the template formatting intact.
Attached is a patch file for report.py in case you're interested