rusackas commented on code in PR #42601:
URL: https://github.com/apache/superset/pull/42601#discussion_r3680999254
##########
superset-frontend/src/utils/downloadAsPivotExcel.ts:
##########
@@ -23,6 +23,10 @@ export default function exportPivotExcel(
fileName: string,
) {
const table = document.querySelector(tableSelector);
- const workbook = utils.table_to_book(table);
+ // `raw: true` keeps every cell as the literal text rendered in the DOM.
+ // Without it, SheetJS tries to infer numbers/dates from the displayed
+ // string, which mangles values that were formatted using a non-US
+ // D3_FORMAT (e.g. "1.234,56" gets misread as a date or truncated number).
+ const workbook = utils.table_to_book(table, { raw: true });
Review Comment:
Good catch, thanks. `raw: true` was killing numeric typing for every cell,
not just the locale-formatted ones. Pushed a fix that restores native number
cells for values that round-trip cleanly through `Number()` (plain
ints/decimals), leaving anything ambiguous (grouped thousands, percent signs,
trailing zero padding) as text so we do not reintroduce the original misparse.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]