Problems reading XLSX created in SAP

Mar 5, 2015 at 4:39 PM
An interesting one this - I've been using ExcelDataReader for ages without problems, but I've just had a problem reading an Open XML spreadsheet created with SAP.

Trying .AsDataSet gives out of memory (ie, looping), while using .Read gives correct results for the first row, then .IsDbNull for every other row - and also loops.

If the spreadsheet is opened and saved in Excel (or OpenOffice), everything is fine.

I had a look at the xml contents, and notices that in xl\worksheets\sheet1.xml, the 1st sheetdata\row has r=0 not r=1. But the 2nd row is r=2!

Clearly, this is a problem with SAP not ExcelDataReader. But is it easily resolved in ExcelDataReader?

ExcelDataReader version 2.1.2.3, Net 2.0

I can't post the whole sheet as it's client data, but here's the relevant part, with r="0" not r="1":
  <sheetData>
    <row r="0" spans="">
      <c r="A1" s="1" t="s">
        <v>202</v>
      </c>
      <c r="B1" s="1" t="s">
        <v>203</v>
      </c>
    </row>
    <row r="2" spans="1:12">
Mar 6, 2015 at 8:17 AM
Have now had a look at the source code, and I think the problem's in ExcelOpenXMLReader.cs, ReadSheetRow. There's a section
            if (_emptyRowCount != 0)
            {
                _cellsValues = new object[sheet.ColumnsCount];
                _emptyRowCount--;
                _depth++;

                return true;
            }
Once _emptyRowCount < 0 this will loop.

Will now find out how to post this on GitHub...