using (ExcelPackage ep = new ExcelPackage(new FileInfo(path))) { ExcelWorksheet ws = ep.Workbook.Worksheets[]; //第1张Sheet 这个用EPPlus 读取excel,代码出错, the given key is not present in the dictionary 原来是因为用wps编辑过的原因. 用Excel重新保存一次就可以了.…
帮助类 using OfficeOpenXml; using OfficeOpenXml.Style; using System; using System.Collections.Generic; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Web; namespace EpPlus.Demo.Models { public class EpPlusHelpe…
参考: http://www.cnblogs.com/rumeng/p/3785748.html http://www.cnblogs.com/libla/p/5824296.html#3818995 结果: 首先新建一个winform程序,然后加一个button, 之后双击button1,进入代码区域,输入下面的代码: using OfficeOpenXml; using OfficeOpenXml.Drawing; using OfficeOpenXml.Drawing.Chart; usi…
//表格的范围需要自己定义 var epplus = new ExcelPackage(); var sheet = epplus.Workbook.Worksheets.Add("Sheet1"); , , row, ]; var wsPivot = epplus.Workbook.Worksheets.Add("数据透视表"); var pt = wsPivot.PivotTables.Add(wsPivot.Cells["A1"], dat…