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

Commented Issue: Failed to open xlsx file exported by ReportViewer [14784]

$
0
0
EPPlus 3.1.2 can't open xlsx exported by ASP.NET ReportViwer, ExcelPackage.Workbook.Worksheets throw a "System.ArgumentNullException: Value cannot be null. Parameter name: String" exception.

Tracing the source code and sheet1.xml in xlsx, I found the column definition nodes are not self-closing:
<col min="1" max="1" customWidth="1" width="10.3515625"></col>

So in ExcelWorksheet.cs LoadColumns(XmlTextReader xr) line 739, a skip logic is required:
while(xr.Read())
{
//2012-12-06 by Jeffrey Lee, to ignore </col> End Element
if (xr.NodeType == XmlNodeType.EndElement) continue;
if(xr.LocalName!="col") break;

Comments: I am also facing ArgumentNullException when trying to index a sheet in the workbook. FileInfo saveFileInfo = new FileInfo(excelFilePath); using (ExcelPackage package = new ExcelPackage(saveFileInfo)) { // http://epplus.codeplex.com/workitem/14784 ExcelWorksheet budgetSheet = package.Workbook.Worksheets[1]; } My Excel file was generated by Gembox Software, but finalized and saved with Excel Interop.

Viewing all articles
Browse latest Browse all 2262

Trending Articles



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