Quantcast
Channel: EPPlus Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 2262

Edited Issue: Zeros (0) get parsed as empty string in excel ark [14787]

$
0
0
When I try to read a 0 (zero) in a excel file the property "ExcelRangeBase.Text" are empty string and not "0" as expected.<br />I have created (and attached) a simple excel ark, only contains a zero in the first cell. When I run this code - the Assert failed:<br /><br />{code:c#}<br />var filepath = @"C:\temp\TestFile.xlsx";<br />using (ExcelPackage package = new ExcelPackage(new FileInfo(filepath)))<br />{<br /> var worksheet = package.Workbook.Worksheets[1];<br /> ExcelRange wsRow = worksheet.Cells[1, 1, 1, 1];<br /> foreach (ExcelRangeBase cell in wsRow)<br /> Assert.AreEqual("0", cell.Text, "Failed to read 0 (zero) from excel ark"); // This get a error - Text are "" (empty string)<br />}<br />{code:c#}<br /><br />Note: if I set a breakpoint at the Assert method and use VS2010 and look at the properties for variable "cell" in debug mode. Then the "cell.Text" property gets the right value.

Viewing all articles
Browse latest Browse all 2262

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>