代码拉取完成,页面将自动刷新
This tutorial introduces Magicodes.IE.Excel already supports merged row cell import.
Install-Package Magicodes.IE.Excel
The reference sample code is shown below.
public class MergeRowsImportDto
{
[ImporterHeader(Name = "学号")]
public long No { get; set; }
[ImporterHeader(Name = "姓名")]
public string Name { get; set; }
[ImporterHeader(Name = "性别")]
public string Sex { get; set; }
}
As shown below:
This file can be found in the test project.
Importing the code is no different from other normal import codes.
var filePath = Path.Combine(Directory.GetCurrentDirectory(), "TestFiles", "Import", "合并行.xlsx");
var import = await Importer.Import<MergeRowsImportDto>(filePath);
The above code can be found in the unit test MergeRowsImportTest
. After debugging and running, you can see the following figure.
This tutorial ends here, if you have questions, please submit more Issue.
Magicodes.IE:导入导出通用库,支持Dto导入导出、模板导出、花式导出以及动态导出,支持Excel、Csv、Word、Pdf和Html。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。