VTable icon indicating copy to clipboard operation
VTable copied to clipboard

[Bug] 导出Excel背景色出现黑色

Open yzhang921 opened this issue 2 months ago • 3 comments

Version

1.20.2

Link to Minimal Reproduction

Steps to Reproduce

import {TableExportPlugin} from '@visactor/vtable-plugins';

    const tableExportPlugin = new TableExportPlugin({
        exportExcelOptions: {
            exportAllData: true,
            downloadFile: false,
            // fileName: `${name}-${dt}`
            formatExcelJSCell: (cellInfo, cellInExceljs) => {
                if (cellInfo.col === 1) {
                }
                // delete cellInExceljs.style.fill;
                return cellInExceljs;
            }
        },
    });

Current Behavior

原表格样式 Image

导出Excel的样子

Image

Debug看了下黑色背景的单元格没有差异 Image

Expected Behavior

正确显示背景色 另外,数字单元格现在都是以文本形式展示,建议设置为数值之后使用exceljscell的numFmt格式化

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

yzhang921 avatar Oct 11 '25 02:10 yzhang921

此外,能否在formatExcelJSCell参数中获取cellInfo属于透视表的哪个部位,如:行表头、列表头、行汇总表头、列汇总表头、小计表头等等

yzhang921 avatar Oct 11 '25 02:10 yzhang921

指标表头出不来,找到原因是indent缩进的问题

Image

没有设置缩进,不知道为什么indent会出现5缩进 Image

yzhang921 avatar Oct 11 '25 07:10 yzhang921

此外,能否在formatExcelJSCell参数中获取cellInfo属于透视表的哪个部位,如:行表头、列表头、行汇总表头、列汇总表头、小计表头等等

let {row, col} = cellInfo
table.getCellHeaderPaths(col, row)

yzhang921 avatar Oct 17 '25 08:10 yzhang921