Quantcast
Channel: Excel Data Reader - Read Excel files in .NET
Viewing all articles
Browse latest Browse all 448

Created Unassigned: Columns skipped when DIMENSION record is incorrect [13101]

$
0
0
A spreadsheet I've encountered in the wild doesn't conform properly to the Excel binary format spec, and in the DIMENSION record uses the zero based index of the last column, rather than the zero based index of the column after the last column, for the colMac value. As a consequence, ExcelDataReader skips reading the last column of the spreadsheet. Excel and OpenOffice both open the file without any problems, and if you save it after opening it, they will fix the bad DIMENSION record.

I've attached the spreadsheet in question. If you're curious about its provenance, you can find it here: http://www.adrbnymellon.com/dr_directory.jsp. You have to look for the "Download to Excel" link, click it, agree to some legalese, and then you can download.

I've written a patch that allows this file to be read properly. It's similar to the fix for Issue #12667; it compares the number of columns from the DIMENSION record with the number of columns from the first row record, and if the number of columns from the row record is greater, it goes with that. The fix does not cause any existing working tests to fail, and I've included a unit test to exercise the new code. The patch is attached.

Viewing all articles
Browse latest Browse all 448

Trending Articles



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