dosubot[bot] commented on issue #38555: URL: https://github.com/apache/superset/issues/38555#issuecomment-4031112058
<!-- Answer --> That explains it! The **"Export to Pivoted Excel" feature runs entirely in the browser** - it doesn't go through the Python backend at all. Based on [PR #33569](https://github.com/apache/superset/pull/33569), this feature: 1. Uses the **SheetJS (xlsx) JavaScript library** in the browser 2. Reads the **rendered HTML pivot table directly from the DOM** (the `.pvtTable` element you see on screen) 3. Converts it to Excel using `XLSX.utils.table_to_book()` client-side 4. Downloads the file directly without any API calls **This is why modifying `superset/utils/excel.py` has no effect** - that code is never executed for pivoted Excel exports. To customize the number formatting for pivoted Excel exports, you'd need to modify the frontend JavaScript code. The relevant file would be something like `downloadAsPivotExcel.ts` in the superset-frontend directory. You can verify this is what's happening by: 1. Opening browser DevTools (F12) → Network tab 2. Clicking "Export to Pivoted Excel" 3. You should see **no network request** to the backend - it's all happening client-side If you want to fix the formatting, the approach would be to find where SheetJS generates the Excel file in the frontend code and configure the number format there. Would you like me to help trace the exact frontend code location? <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/a6a0b31e-764b-46db-8da1-a6d6053fbc9c?feedback_type=great_response&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/a6a0b31e-764b-46db-8da1-a6d6053fbc9c?feedback_type=irrelevant_answer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/a6a0b31e-764b-46db-8da1-a6d6053fbc9c?feedback_type=incorrect_sources&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/a6a0b31e-764b-46db-8da1-a6d6053fbc9c?feedback_type=too_verbose&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/a6a0b31e-764b -46db-8da1-a6d6053fbc9c?feedback_type=hallucination&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/a6a0b31e-764b-46db-8da1-a6d6053fbc9c?feedback_type=bug_report&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report) | [Other](https://app.dosu.dev/response-feedback/a6a0b31e-764b-46db-8da1-a6d6053fbc9c?feedback_type=other&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge) [](https://cursor.com/link/prompt?text=That%20explains%20it%21%20The%20%2A%2A%22Export%20to%20Pivoted%20Excel%22%20feature%20runs%20entirely%20in%20the%20browser%2A%2A%20-%20it%20doesn%27t%20go%20through%20the%20Python%20backend%20at%20all.%0A%0ABased%20on%20%5BPR%20%2333569%5D%28https%3A//github.com/apache/superset/pull/33569%29%2C%20this%20feature%3A%0A1.%20Uses%20the%20%2A%2ASheetJS%20%28xlsx%29%20JavaScript%20library%2A%2A%20in%20the%20browser%0A2.%20Reads%20the%20%2A%2Arendered%20HTML%20pivot%20table%20directly%20from%20the%20DOM%2A%2A%20%28the%20%60.pvtTable%60%20element%20you%20see%20on%20screen%29%0A3.%20Converts%20it%20to%20Excel%20using%20%60XLSX.utils.table_to_book%28%29%60%20client-side%0A4.%20Downlo ads%20the%20file%20directly%20without%20any%20API%20calls%0A%0A%2A%2AThis%20is%20why%20modifying%20%60superset/utils/excel.py%60%20has%20no%20effect%2A%2A%20-%20that%20code%20is%20never%20executed%20for%20pivoted%20Excel%20exports.%0A%0ATo%20customize%20the%20number%20formatting%20for%20pivoted%20Excel%20exports%2C%20you%27d%20need%20to%20modify%20the%20frontend%20JavaScript%20code.%20The%20relevant%20file%20would%20be%20something%20like%20%60downloadAsPivotExcel.ts%60%20in%20the%20superset-frontend%20directory.%20You%20can%20verify%20this%20is%20what%27s%20happening%20by%3A%0A1.%20Opening%20browser%20DevTools%20%28F12%29%20%E2%86%92%20Network%20tab%0A2.%20Clicking%20%22Export%20to%20Pivoted%20Excel%22%0A3.%20You%20should%20see%20%2A%2Ano%20network%20request%2A%2A%20to%20the%20backend%20-%20it%27s%20all%20happening%20client-side%0A%0AIf%20you%20want%20to%20fix%20the%20formatting%2C%20the%20approach%20would%20be%20to%20find%20where%20SheetJS%20generates%20the%20Excel%20file%20in%20th e%20frontend%20code%20and%20configure%20the%20number%20format%20there.%20Would%20you%20like%20me%20to%20help%20trace%20the%20exact%20frontend%20code%20location%3F) [](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/38555) -- 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]
