Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
In /includes/exporters/webform_exporter_excel_xlsx.inc
:
elseif (is_numeric($value) && $value[0] !== '+') {
$output .= '<c r="' . $cell_position . '"><v>';
$output .= $value;
$output .= '</v></c>';
}
is assuming that all numeric values should be exported as numbers to Excel. This is a problem because for big numbers Excel rounds it to the nearest value it can store, causing data loss. Also, values that contain leading zeros cannot be stored, even if the webform field is configured as a textfield.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2860487-2.patch | 803 bytes | mercepedraza |
|
Comments
Comment #2
mercepedraza CreditAttribution: mercepedraza at Ymbra commentedComment #3
mercepedraza CreditAttribution: mercepedraza at Ymbra commentedComment #4
joelpittetThat seems reasonable
Comment #5
Liam MorlandI am concerned that this will break workflows. What happens if someone relies on opening a spreadsheet and doing math on the values?
Comment #6
Pere OrgaI just checked on MS Excel 2013 and patch in #2 does not break doing math on these cells.
Also, the description is a bit misleading, patch in #2 is changing the cell style from "Number" to "General", not "Text" (as seen in Excel -note, I have Excel in Spanish so that was my translation of the style names, names in English may be a bit different). FWIW, I just checked Libreoffice and still considers/displays these cells to be numbers, but I guess that's OK because LibreOffice, unlike Excel, does not try to convert the value of these cells automatically.
I don't know much about OOXML, but this LGTM.
Comment #8
Liam MorlandComment #10
StijnStroobantsOne of our clients want to export certain webform-data as number-format.
Isn't is better to set this option as an option for the export?
Comment #11
Liam MorlandI understand from #6 that they still work as numbers for doing math. If it doesn't do what you client needs, that could be a feature request. If you want to do that, please make a child ticket.