VisActor / VisActor/VTable

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

Open
#4,560 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
3.7k
Forks
486
Avg merge
1d 19h
Merged PRs (30d)
16

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the TableExportPlugin configuration and its formatExcelJSCell export path, using the provided snippet to reproduce the Excel output. Compare exported cell fill styles with the source table and check how numeric cells are typed and formatted. Done means background colors render correctly and numeric cells are exported as numbers with the expected formatting.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.