工具类 using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; namespace Trumgu_BI_PF.Util { public static class NpoiHelper { /// <summary> /// dataset导出…
using System; using System.Collections.Generic; using System.Text; using System.Data; using System.IO; using System.Web; using Microsoft.Office.Interop.Excel; using System.Reflection; /* * 开发人员:Hisen * 时间:2008年11月24日 * 功能:将数据导出Excel * */ namespa…
1.添加引用NPOI.dll 2.cs文件头部添加 using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; using System.IO; 3.代码如下: using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Configuration;…
步骤: 一.前台JS取HtmlTable数据,根据设定的分隔符把数据拼接起来 <!--导出Excel--> <script type="text/javascript"> //导出Excel function exportExcel() { var data = ""; $("#divRptTable").find("table").find("tr").each(function…
using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; using Newtonsoft.Json; namespace EasyFrame.Common { /// <summary> ///title调用信息 /// </summar…
using System; using System.Collections.Generic; using System.Text; using System.IO; using NPOI.SS.UserModel; //NPOI using NPOI.HSSF.Util; //NPOI using NPOI.HSSF.UserModel; //NPOI using NPOI.XSSF.UserModel; //NPOI using System.Data.SqlClient; using Sy…
1.通过NUGET管理器下载nopi,在引入命令空间 using System; using System.Collections.Generic; using System.Text; using System.IO; using NPOI.SS.UserModel; //NPOI using NPOI.HSSF.Util; //NPOI using NPOI.HSSF.UserModel; //NPOI using NPOI.XSSF.UserModel; //NPOI using Syst…
/// <summary> /// 提供将泛型集合数据导出Excel文档. /// </summary> /// <typeparam name="T"></typeparam> public class ExcelResult<T> : ActionResult where T : new() { public ExcelResult(IList<T> entity, string fileName, bool…