Skip to content

2.2.0-beta2版本以Append方式导出多个sheet时,发生“Tablename is not unique”错误 #66

Description

@Superllb93

2.2.0-beta2版本以Append方式导出多个sheet时,当Append的ICollection均为空集合时,报 “Tablename is not unique”错误,比如:

new ExcelExporter().Append(new List<Student>()).Append(new List<Teacher>()).ExportAppendData("test.xlsx");

image

详细错误信息如下:

System.ArgumentException
  HResult=0x80070057
  Message=Tablename is not unique
  Source=EPPlus
  StackTrace:
   at OfficeOpenXml.Table.ExcelTableCollection.Add(ExcelAddressBase Range, String Name)
   at Magicodes.ExporterAndImporter.Excel.Utility.ExportHelper`1.AddHeader()
   at Magicodes.ExporterAndImporter.Excel.Utility.ExportHelper`1.AddHeaderAndStyles()
   at Magicodes.ExporterAndImporter.Excel.Utility.ExportHelper`1.Export(ICollection`1 dataItems)
   at Magicodes.ExporterAndImporter.Excel.ExcelExporter.Append[T](ICollection`1 dataItems)
   at Magicodes.IE.Excel.Program.Export() in E:\Technology\Magicodes.IE.Excel\Magicodes.IE.Excel\Program.cs:line 29
   at Magicodes.IE.Excel.Program.Main(String[] args) in E:\Technology\Magicodes.IE.Excel\Magicodes.IE.Excel\Program.cs:line 15

@xin-lai 请帮忙尽快解决,谢谢

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions