epplus-4

EPPlus : date column returning int rather than the actual displayed text value

我只是一个虾纸丫 提交于 2020-06-27 23:09:25
问题 I am using EPPlus to read excel data. I need to display the excel cells as-is in the grid to the users. while reading date column EPPlus is giving the OADate int value for the date. Is there a way I can read the value as string, which users normally see when they open the excel. i.e. the value after applying the excel formats. There does not seem to be any function on the CELL class which provides valueAsString or valueAsDisplayed, etc... 回答1: If the dates are stored in excel as doubles (or a

Worksheet position out of range. Connection Closed. When using EPPLUS

。_饼干妹妹 提交于 2020-03-18 11:08:47
问题 I am trying to open an XLSX file as a template (I have even used a blank XLSX file), using EPPLUS 4.0.3. If I do not open the template file (blank or the real one) and just create a new workbook and create a sheet, it works fine. OR if I open the template file, and create a NEW worksheet, then it works fine. It is only when I try to access the FIRST sheet in the template that I get the error: Worksheet position out of range. Accessing the first worksheet like this: workBook.Worksheets.First()

How to un-merge cells EPPlus?

北城余情 提交于 2020-01-04 02:53:06
问题 I'm trying to un-merge and re-merge shorter or longer range depending on the the number of table columns I used this code below but it doesnt seem to work tableSheet.Cells["C1:J1"].Merge = false; Any help will be highly appreciated. 回答1: Are you running EPP 4.0.1? If so, it is a known issue: https://epplus.codeplex.com/workitem/15134 Someone posted a replacement setter for the Merge property (although the getter is still incorrect it seems). When I pasted their replacement setter in

Error reading xlsx (2007) file in EPPLUS

跟風遠走 提交于 2019-12-22 10:34:04
问题 I have an error while trying to read excel files ( xlsx ) which were saved in Excel 2007 using EPPlus library. Some workaround: ASP.net mvc 5 app with EPPlus v. 4.0.4.0 User can download template file from my site, then fill required data in it, and upload it back. File contains 4 worksheets, one of them is hidden . Workbook is password protected, worksheets are proteced too. All of them have different passwords. Template file ( xlsx ) produced in Excel 2007 or 2010 . When user posts file

Is there a way to get 'named' cells using EPPlus?

谁都会走 提交于 2019-12-19 05:34:41
问题 I have an Excel file that I am populating programmatically with EPPlus. I have tried the following: // provides access to named ranges, does not appear to work with single cells worksheet.Names["namedCell1"].Value = "abc123"; // provides access to cells by address worksheet.Cells["namedCell1"].Value = "abc123"; The following does work - so I know I am at least close. worksheet.Cells["A1"].Value = "abc123"; 回答1: Actually, its a bit misleading. The Named Ranges are stored at the workBOOK level

EPPlus save two million rows with 200+ columns datatable to multiple excel files

隐身守侯 提交于 2019-12-19 04:09:29
问题 I have function that saves all records from SQL table to excel worksheet using EPPlus. If I export small amount of data everything works fine, but with 200+ columns and 500 000+ rows I get OutOfMemory exception. I'd like to modify my code in a way to be able to save 50 000 records per file. Here is my code that works for small data: private Task SaveAsync(string tableName) { return Task.Run(() => { try { using (var conn = new SqlConnection(_connectionString)) { using (var cmd = new SqlCommand

Importing excel file with all the conditional formatting rules to epplus

 ̄綄美尐妖づ 提交于 2019-12-18 09:03:56
问题 I have an excel file which contains lots of data along with icon sets and data bars based on the values in the cell. It looks like this: I want to import this excel sheet along with the conditional formatting. Is there any library for this?? I went through this http://www.sitecorecleveland.com/resources/blogs-posts/easy_excel_interaction_pt6 but it only imports data not format. If that's not possible is there code in epplus to have these iconsets in excel sheet. I can have arrows, traffic

Why am I getting, “Cannot implicitly convert type 'void' to 'object'” with this code (EPPlus)?

守給你的承諾、 提交于 2019-12-13 07:54:52
问题 I was using this code to populate a cell in a spreadsheet using EPPlus: using (var footerMonth1Cell = prodUsageWorksheet.Cells[columnFooterRow, MONTH1_COL]) { footerMonth1Cell.Value = monthsTruncatedYears[0]; footerMonth1Cell.Style.Font.Size = DATA_FONT_SIZE; footerMonth1Cell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Right; } It was working fine, I thought, but a user complained that it was producing "green triangles" in the cells. "monthsTruncatedYears" is a generic list of string