epplus

EPPlus Excel Row Height not consistent

左心房为你撑大大i 提交于 2019-12-10 18:56:35
问题 I have generated an excel file using EPPlus and everything seems to be perfect in MS Office 2007 but the client is using MS Office 2010/2013 and there the Row height is not set after the 29th Row. It is a very weird issue and I have been trying to do this for 4 days but am not able to fix it. I have attached an issue screenshot from excel. List<spGetInventoryPrintForLabel> inventories = coreInventory.GetInventoryListForLabel(inventoryIDs); string fileName = Path.Combine(Server.MapPath("~

EPPLUS AutoFit cells

早过忘川 提交于 2019-12-10 18:39:01
问题 how can i set autosize on my cells, based on the max length of one input. using (rng = workSheet.Cells["A1:G1"]) { rng.Style.Font.Bold = true; rng.Style.Fill.PatternType = ExcelFillStyle.Solid; rng.Style.Fill.BackgroundColor.SetColor(Color.DarkBlue); rng.Style.Font.Color.SetColor(Color.White); } using (ExcelRange col = workSheet.Cells[2, 6, 7, 7]) { col.Style.Numberformat.Format = "yyyy-mm-dd HH:mm"; col.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right; } for (int i = 1; i <= a; i++

EPPlus dependency loop

亡梦爱人 提交于 2019-12-10 18:27:36
问题 When installing EPPlus from PowerShell, I get the following (all commands are being run for the first time): $PackageSource=Get-PackageSource -Name "PSGallery" if (!$PackageSource.IsTrusted) { Set-PackageSource -Trusted -Name "PSGallery" > $null } # NuGet PackageProvider $PackageProvider=Get-PackageProvider -ListAvailable | Where-Object { $_.Name -eq "NuGet" } $InstallPackageProvider=$false if ($PackageProvider -eq $null) { $InstallPackageProvider=$true } else { $TargetVersion=[Microsoft

Problems opening .xlsx file created with EPPlus and zipped in a folder with ICSharpCode.SharpZipLib

╄→гoц情女王★ 提交于 2019-12-10 18:08:26
问题 I am creating a list of ExcelPackages (xlsx documents) using EPPlus, and adding them to a ZipOutputStream as ZipEntries. I think the Excel documents should be valid, as I can open them just fine when I write one of them to the Response object without zipping. The zip folder is created as expected, and the file(s) are there and doesnt seem to be empty, but when I try to open them I get the following error in Excel: Excel cannot open the file {Name}.xlsx because the file format or file

How do I modify a chart series using EPPLus?

前提是你 提交于 2019-12-10 17:57:18
问题 I want to ask about how to update series value of existing chart in excel using EPPLUS library. I can't find yet how to do it. I have created chart successfully, but still can't to update the series value. Anyone can provide me some sample code or reference link? 回答1: Sorry to answer so late (came accross your post while searching for something else). If the chart has a series which are pointed at cells in a worksheet, why cant you just update the cell values directly? Like this, first create

EPPlus / How to get data from pivot table? Or how to manipulate data easily?

十年热恋 提交于 2019-12-10 17:04:34
问题 I am wasting very much time on manipulating data in reports. Using pivot table is a good idea but how? I tried some free PivotTable classes but they were lacking subtotals. Then, another approach. For excel output of reports I am using EPPlus . It also supports pivottable. The problem is some of our customers do not have office(OpenOffice, MicrosoftOffice etc.), so just creating and saving an xlsx file does not work. The only thing I can try with EPPlus is creating an ExcelPackage , filling a

EPPLUS To Clear Contents of A Range Of Cells

跟風遠走 提交于 2019-12-10 16:05:54
问题 I want to use EPPLUS to clear a range of cells. I tried the syntax below, but it gives me an error of object reference not set to an instance of an object What would be the proper way to clear the contents of cells A24:C36 with EPPLUS? ExcelPackage package = new ExcelPackage(); ExcelWorksheet ws = package.Workbook.Worksheets["Sheet1"]; ws.Cells["A24:C36"].Clear(); 回答1: Your code is correct. I think the .xlsx file does not have Worksheets with Sheet1 name. For example, I created this excel

Reading from a Excel Cell

流过昼夜 提交于 2019-12-10 15:03:51
问题 I am using EPPlus package to read from an .xlsx file. I need to read a TimeSpan object from a cell. The excel cell would contain a data in "hh:mm" format, for example: "09:00" or "18:30" without the quotation marks. Here is my code: string myString = workSheet.Cells[1,1].Value.ToString(); double d = double.Parse(myString); DateTime dt = DateTime.FromOADate(d); TimeSpan ts = new TimeSpan(dt.Hour, dt.Minute, dt.Second); for "09:00" or "08:30" data in excel file myString contains "0.375", or "0

C# ExcelPackage (EPPlus) DeleteRow does not change sheet dimension?

与世无争的帅哥 提交于 2019-12-10 14:55:17
问题 I am trying to build a data import tool that accepts an EXCEL file from the user and parses the data from the file to import data into my application. I am running across a strange issue with DeleteRow that I cannot seem to find any information online, although it seems like someone would have come across this issue before. If this is a duplicate question, I apologize, however I could not find anything related to my issue after searching the web, except for this one which still isn't solving

'Duplicate headers received from server' Error in Chrome 16 with EPPlus 2.9

淺唱寂寞╮ 提交于 2019-12-10 14:34:57
问题 I'm playing around with EPPlus 2.9 and for some reason I'm getting Duplicate headers received from server errors when I try to download single .xlsx files using Chrome 16 (It works fine in IE9). I'm using this tutorial and I've narrowed down the problem to this line of code: Response.AppendHeader("Content-Disposition", "attachment; " + "filename=\"ExcelReport.xlsx\"; " + "size=" + fileBytes.Length.ToString() + "; " + "creation-date=" + DateTime.Now.ToString("R") + "; " + "modification-date="