epplus

OpenXML / EPPlus - Create PivotCache in .Net

╄→尐↘猪︶ㄣ 提交于 2019-12-22 05:55:04
问题 I'm hoping this could help me, at least, answer one of the 2 questions I asked here, but I am looking how to create a PivotCache in EPPlus / OpenXML and can't find anything online / in their documentation that shows how to do it. So, suposing I have one Excel sheet, wksRawData created in EPPlus and I want to create a second sheet with a pivot table based upon the pivot cache of wksRawData.Cells(wksRawData.Dimension.Address) - In the hopes that then I could delete wksRawData but still keep the

EPPlus missing dependency

大城市里の小女人 提交于 2019-12-22 04:42:24
问题 I added EPPlus and usage of OfficeOpenXml to my project. However, when I run my project I get this errors and warning : Warning : The referenced assembly "EPPlus" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.

EPPlus missing dependency

拟墨画扇 提交于 2019-12-22 04:42:14
问题 I added EPPlus and usage of OfficeOpenXml to my project. However, when I run my project I get this errors and warning : Warning : The referenced assembly "EPPlus" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.

Trying to read an Excel file with EPPlus works on the server, but not through a browser

被刻印的时光 ゝ 提交于 2019-12-21 09:26:13
问题 When I published my project and ran it on the server, it worked. EPPlus found all 4 worksheets, iterated through them, and uploaded my data to SQL. But when I run it through my browser, or my coworkers browser, it shows 0 worksheets. Any idea why this might be happening? There's not much to the code at that point, but here's that part: using (ExcelPackage package = new ExcelPackage(new FileInfo(strFile))) { if (package.Workbook.Worksheets.Count <= 0) strError = "Your Excel file does not

How can i get actual used range for modified excels using Epplus?

泄露秘密 提交于 2019-12-21 07:15:13
问题 I am reading data from excel to datable using EPPlus. After reading an excel sheet with 10 rows of record, I modified the excel sheet by removing existing data and kept data for only one row. But when I am reading the modified excel it still reading 10 rows (1 with value and remaining as null fields) to data table. How can limit this? I am using following code for reading Excel. using (var pck = new OfficeOpenXml.ExcelPackage()) { using (var stream = File.OpenRead(FilePath)) { pck.Load(stream

Epplus example of `LoadFromCollection<T>(IEnumerable<T>, Boolean, TableStyles, BindingFlags, MemberInfo[])`

浪尽此生 提交于 2019-12-21 04:39:41
问题 When using Epplus ExcelPackage, I typically use a basic LoadFromCollection function to populate a Worksheet, like in this manner: worksheet.Cells[1, 1].LoadFromCollection(Collection:data, PrintHeaders:true); On this site, I see the listing of other overloads of that function, but no specific examples. This one looks interesting. Can someone provide a basic example of this function overload in use? LoadFromCollection<T>(IEnumerable<T> Collection, Boolean PrintHeaders, TableStyles TableStyle,

EPPlus, handling big ExcelWorksheet

三世轮回 提交于 2019-12-20 03:09:31
问题 I'm using EPPlus to create xls report on daily and weekly basis. But sometimes the timeline is greater than one year and, in my last case it was three year, so the total amount of rows are around 180k. In this case I've optimized the query against a SQL Server DB but I think that my bottle neck is the "ExcelWorksheet" object: I'm guessing if there's chance to save it on file 50k rows per times instead of save it totally, so the memory usage could be less than now. Anyone has an idea about an

Defining a table rather than a range as a PivotTable 'cacheSource'

梦想与她 提交于 2019-12-20 02:34:43
问题 I am building a tool to automate the creation of an Excel workbook that contains a table and an associated PivotTable. The table structure is on one sheet, the data for which will be pulled from a database using another tool at a later point. The PivotTable is on a second sheet using the table from the previous sheet as the source. I am using EPPlus to facilitate building the tool but am running into problems specifying the cacheSource . I am using the following to create the range and

EPPlus how to change colors of PIE Chart in EXCEL

老子叫甜甜 提交于 2019-12-19 19:59:46
问题 How to change the default colors of Excel Pie Chart using EPPlus programatically. below is my code var pieChart = worksheet.Drawings.AddChart("piechart", eChartType.Pie3D) as ExcelPieChart; //Set top left corner to row 1 column 2 pieChart.SetPosition(18, 0, 0, 0); pieChart.SetSize(350, 300); pieChart.Series.Add(ExcelRange.GetAddress(12, 2, 15, 2),ExcelRange.GetAddress(12, 1, 15, 1) ); pieChart.Legend.Position = eLegendPosition.Bottom; pieChart.Legend.Border.Fill.Color = Color.Green; pieChart

How to set the style for an entire column in EPPlus?

百般思念 提交于 2019-12-19 14:38:45
问题 Is it possible to set the style for an entire column in EPPlus? I would expect that I could just use the Column method, but when I do I get strange results: //Sets all cells in all columns to Red worksheet.Column(1).Style.Font.Color.SetColor(Color.Red); //Sets some cells in column B to red. worksheet.Column(2).Style.Font.Color.SetColor(Color.Red); In both cases I am setting the colour after adding some header rows but before adding the bulk of the rows am an not setting the colour anywhere