Skip to content

Properties of type long are not converted to text correctly #627

Description

@The-Mojoo

Excel Type

  • XLSX
  • XLSM
  • CSV
  • OTHER

Upload Excel File

[
b25a7003-8062-4c93-8926-a1a1407697a8.xlsx
](url)

MiniExcel Version

1.33.0

Description

我的数据源有long类型的字段,已经在代码中将excel的列格式设置为文本格式(@),虽然生成的excel看起来是正常显示了的,但实际上点击下就变成了科学计数法,而且列的格式显示的仍然是常规。

image
image

var path = Path.Combine("C:\\Demo\\", $"{Guid.NewGuid()}.xlsx");
var config = new OpenXmlConfiguration
{
    AutoFilter = false,
    DynamicColumns =
    [
        new DynamicExcelColumn("long2") { Format = "@", Width = 25 },
    ]
};
var value = new[] { new { long2 = "1550432695793487872" } };
MiniExcel.SaveAs(path, value, configuration: config);

Activity

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

Metadata

Metadata

Assignees

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