Skip to content

2.8+ 版本的自定义模板导出的excel文件出现大量重复的模板内容 #610

Closed

Description

@AshWang-whm

Expected behaviour

20行的测试数据
2.8+ 版本的自定义模板导出的excel文件出现大量重复的模板内容,文件体积非常大,31MB
2.7+ 版本生成的excel文件正确仅10kb

Image Image

Actual behaviour

Tell us what happens instead. Provide a log message if relevant.

I'm seeing this behaviour on

Remove this hint: these checkboxes can be checked like this: [x]

  • Magicodes.IE.Excel
  • [ x] Magicodes.IE.Pdf
  • [ x] Magicodes.IE.Word
  • [ x] Magicodes.IE.Csv
  • [ x] Magicodes.IE.Html
  • [ x] Magicodes.IE.AspNetCore

package versions

Example: Magicodes.IE.Excel 2.8

So how can we reproduce this?

自定义模板导出bug-Test

Good ⭐⭐⭐

Provide your own app and instructions how to reproduce the issue.

Meh ⭐⭐

Provide a code sample with a bunch of magic parameters which I need to interpolate by guessing to reconstruct the actual runtime code.

Worst 💩

Say the source code can't be disclosed and refuse to provide any of the above. Expect this issue to be closed by a bunch of angry aliens 👽👽👽👽👽 that will hunt you down and 🔥 your 💻. You've been warned. 🚒

Activity

  1. wa926talent commented on Jan 16, 2026

    @wa926talent

    2.8.0没有问题,2.8.1,2.8.2都出现了同样的问题

  2. qx105b commented on Jan 29, 2026

    @qx105b

    我以为是我使用的问题呢?原来是类库的bug

  3. AshWang-whm commented on Jan 30, 2026

    @AshWang-whm
    Author

    我以为是我使用的问题呢?原来是类库的bug

    我也是直接更新组件,没测试就发布了,结果后面发现这些excel数据有问题

  4. AshWang-whm commented on Jan 30, 2026

    @AshWang-whm
    Author

    2.8.0没有问题,2.8.1,2.8.2都出现了同样的问题

    我提交了个测试的pr给作者,看看几时能fix吧

  5. porter2019 commented on Feb 10, 2026

    @porter2019

    我一台服务器上出现这个问题,另一台又没有,都是2.8.2!

  6. KaneLeung commented on Mar 26, 2026

    @KaneLeung

    刚升了2.8.2 开发机Win11和服务器Linux都有同样问题

  7. hueifeng commented on May 30, 2026

    @hueifeng
    Member

    已处理。根因在 TemplateExportHelper.cs 的 RowCopy(...) 复制范围在特定迭代场景下会过度复制,导致模板 {{...}} 残留并引发文件膨胀。已收紧复制边界并新增回归测试 RowCopy_ShouldNotOverCopyTemplateRows_Regression610_Test,相关用例本地通过。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions