You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ms...@apache.org on 2025/08/21 13:18:03 UTC

(superset) 01/01: fix(PivotExcelExport): select correct chart for export

This is an automated email from the ASF dual-hosted git repository.

msyavuz pushed a commit to branch msyavuz/fix/pivot-excel-export-first
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 46cee0bc00f5d5076ebe854dab859e3140a1be85
Author: Mehmet Salih Yavuz <sa...@proton.me>
AuthorDate: Thu Aug 21 16:17:14 2025 +0300

    fix(PivotExcelExport): select correct chart for export
---
 .../src/dashboard/components/SliceHeaderControls/index.tsx          | 6 +++++-
 .../explore/components/useExploreAdditionalActionsMenu/index.jsx    | 3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx
index 2dcc08966d..0876874074 100644
--- a/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx
+++ b/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx
@@ -271,7 +271,11 @@ const SliceHeaderControls = (
         break;
       }
       case MenuKeys.ExportPivotXlsx: {
-        props.exportPivotExcel?.('.pvtTable', props.slice.slice_name);
+        const sliceSelector = `#chart-id-${props.slice.slice_id}`;
+        props.exportPivotExcel?.(
+          `${sliceSelector} .pvtTable`,
+          props.slice.slice_name,
+        );
         break;
       }
       case MenuKeys.CrossFilterScoping: {
diff --git a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx
index 40fdd29460..19278a747b 100644
--- a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx
+++ b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx
@@ -333,8 +333,9 @@ export const useExploreAdditionalActionsMenu = (
           icon: <Icons.FileOutlined />,
           disabled: !canDownloadCSV,
           onClick: () => {
+            const sliceSelector = `#chart-id-${slice?.slice_id}`;
             exportPivotExcel(
-              '.pvtTable',
+              `${sliceSelector} .pvtTable`,
               slice?.slice_name ?? t('pivoted_xlsx'),
             );
             setIsDropdownVisible(false);