EPPlus封装导出Excel,更简单,合并单元格更方便

上传者: superman26 | 上传时间: 2021-08-20 01:25:43 | 文件大小: 1.23MB | 文件类型: RAR
EPPlus功能齐全,太过臃肿,特别是对单元格合并比较复杂,我只需要简单的一个导出Excel的功能,所以进行了封装。 1.下载解压可直接运行项目 2.运行示例,访问api:GET https://localhost:44334/weatherforecast/Export 3.查看示例代码,和注释 4.使用方式: · new一个Excel文件 ·新建一个工作博(可建多个) ·添加Excel的表头(不需要的可以不添加) ·添加对应工作博的数据 ·以流的方式写入httpresponse,浏览器即可自动下载。 注意: 1.数据类容需要理解思路,如果不需要合并的情况下就是一个List的实体类,类名随便取。 2.如果有合并的,那么数据类就是一个list的实体下再包涵一个list实体,参见示例。 3.使用的整体思路就是用数格子的方式,封装的思路就是用反射的方式分析数据类自动对应。 4.核心类ExcelExportHelper.cs,只需要把该类添加到自己的项目中,在NuGet中安装EPPlus即可使用该类。

文件下载

资源详情

[{"title":"( 72 个子文件 1.23MB ) EPPlus封装导出Excel,更简单,合并单元格更方便","children":[{"title":".vs","children":[{"title":"ExcelExportHelper","children":[{"title":"v16","children":[{"title":".suo <span style='color:#111;'> 3.50KB </span>","children":null,"spread":false}],"spread":true},{"title":"DesignTimeBuild","children":[{"title":".dtbcache.v2 <span style='color:#111;'> 114.46KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"bin","children":[{"title":"Debug","children":[{"title":"net5.0","children":[{"title":"ExcelExportHelper.runtimeconfig.json <span style='color:#111;'> 304B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.dll <span style='color:#111;'> 22.00KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.pdb <span style='color:#111;'> 23.73KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.deps.json <span style='color:#111;'> 156.42KB </span>","children":null,"spread":false},{"title":"ref","children":[{"title":"ExcelExportHelper.dll <span style='color:#111;'> 10.50KB </span>","children":null,"spread":false}],"spread":true},{"title":"ExcelExportHelper.exe <span style='color:#111;'> 123.00KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.runtimeconfig.dev.json <span style='color:#111;'> 313B </span>","children":null,"spread":false},{"title":"appsettings.Development.json <span style='color:#111;'> 168B </span>","children":null,"spread":false},{"title":"appsettings.json <span style='color:#111;'> 192B </span>","children":null,"spread":false},{"title":"System.Xml.XPath.XmlDocument.dll <span style='color:#111;'> 115.90KB </span>","children":null,"spread":false},{"title":"EPPlus.dll <span style='color:#111;'> 1.24MB </span>","children":null,"spread":false}],"spread":false},{"title":"netcoreapp3.1","children":[{"title":"ExcelExportHelper.runtimeconfig.json <span style='color:#111;'> 311B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.dll <span style='color:#111;'> 22.00KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.pdb <span style='color:#111;'> 23.54KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.deps.json <span style='color:#111;'> 156.03KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.exe <span style='color:#111;'> 170.50KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.runtimeconfig.dev.json <span style='color:#111;'> 252B </span>","children":null,"spread":false},{"title":"appsettings.Development.json <span style='color:#111;'> 168B </span>","children":null,"spread":false},{"title":"appsettings.json <span style='color:#111;'> 192B </span>","children":null,"spread":false},{"title":"System.Xml.XPath.XmlDocument.dll <span style='color:#111;'> 115.90KB </span>","children":null,"spread":false},{"title":"EPPlus.dll <span style='color:#111;'> 1.24MB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"WeatherForecast.cs <span style='color:#111;'> 311B </span>","children":null,"spread":false},{"title":"Program.cs <span style='color:#111;'> 887B </span>","children":null,"spread":false},{"title":"TestData.cs <span style='color:#111;'> 824B </span>","children":null,"spread":false},{"title":"obj","children":[{"title":"project.assets.json <span style='color:#111;'> 187.57KB </span>","children":null,"spread":false},{"title":"project.nuget.cache <span style='color:#111;'> 11.95KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.csproj.nuget.dgspec.json <span style='color:#111;'> 2.70KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.csproj.nuget.g.targets <span style='color:#111;'> 294B </span>","children":null,"spread":false},{"title":"Debug","children":[{"title":"net5.0","children":[{"title":"ExcelExportHelper.dll <span style='color:#111;'> 22.00KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.RazorTargetAssemblyInfo.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.pdb <span style='color:#111;'> 23.73KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.assets.cache <span style='color:#111;'> 33.70KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.csproj.FileListAbsolute.txt <span style='color:#111;'> 2.54KB </span>","children":null,"spread":false},{"title":"ref","children":[{"title":"ExcelExportHelper.dll <span style='color:#111;'> 10.50KB </span>","children":null,"spread":false}],"spread":false},{"title":"ExcelExportHelper.csproj.AssemblyReference.cache <span style='color:#111;'> 11B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.MvcApplicationPartsAssemblyInfo.cache <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":".NETCoreApp,Version=v5.0.AssemblyAttributes.cs <span style='color:#111;'> 190B </span>","children":null,"spread":false},{"title":"staticwebassets","children":[{"title":"ExcelExportHelper.StaticWebAssets.Manifest.cache <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.StaticWebAssets.xml <span style='color:#111;'> 36B </span>","children":null,"spread":false}],"spread":false},{"title":"ExcelExportHelper.csproj.CoreCompileInputs.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false},{"title":"apphost.exe <span style='color:#111;'> 123.00KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.AssemblyInfoInputs.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.csproj.CopyComplete <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.GeneratedMSBuildEditorConfig.editorconfig <span style='color:#111;'> 347B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.AssemblyInfo.cs <span style='color:#111;'> 1.01KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.genruntimeconfig.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false}],"spread":false},{"title":"netcoreapp3.1","children":[{"title":"ExcelExportHelper.dll <span style='color:#111;'> 22.00KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.RazorTargetAssemblyInfo.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.pdb <span style='color:#111;'> 23.54KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.assets.cache <span style='color:#111;'> 33.65KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.csproj.FileListAbsolute.txt <span style='color:#111;'> 2.40KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.MvcApplicationPartsAssemblyInfo.cache <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"staticwebassets","children":[{"title":"ExcelExportHelper.StaticWebAssets.Manifest.cache <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.StaticWebAssets.xml <span style='color:#111;'> 36B </span>","children":null,"spread":false}],"spread":false},{"title":"ExcelExportHelper.csprojAssemblyReference.cache <span style='color:#111;'> 424B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.csproj.CoreCompileInputs.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false},{"title":"apphost.exe <span style='color:#111;'> 170.50KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.AssemblyInfoInputs.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.csproj.CopyComplete <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":".NETCoreApp,Version=v3.1.AssemblyAttributes.cs <span style='color:#111;'> 190B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.AssemblyInfo.cs <span style='color:#111;'> 1.01KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.genruntimeconfig.cache <span style='color:#111;'> 42B </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"ExcelExportHelper.csproj.nuget.g.props <span style='color:#111;'> 1.50KB </span>","children":null,"spread":false}],"spread":true},{"title":"Controllers","children":[{"title":"WeatherForecastController.cs <span style='color:#111;'> 8.21KB </span>","children":null,"spread":false}],"spread":true},{"title":"Startup.cs <span style='color:#111;'> 1.43KB </span>","children":null,"spread":false},{"title":"ExcelExportHelper.csproj <span style='color:#111;'> 243B </span>","children":null,"spread":false},{"title":"ExcelExportHelper.cs <span style='color:#111;'> 15.89KB </span>","children":null,"spread":false},{"title":"appsettings.Development.json <span style='color:#111;'> 168B </span>","children":null,"spread":false},{"title":"appsettings.json <span style='color:#111;'> 192B </span>","children":null,"spread":false},{"title":"Properties","children":[{"title":"launchSettings.json <span style='color:#111;'> 825B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明