Quantcast
Channel: ResX Resource Manager
Viewing all articles
Browse latest Browse all 2435

Commented Unassigned: Regression in spreadsheet import [4614]

$
0
0
Regression in version 1.0.0.57 for importing spreadsheets. Reverting to 1.0.0.56 resolves the issue.

Invalid Cast Exception - Unable to cast object of type System.Collections.Generic.IEnumerable<System.String> to System.Collections.Generic.IList<System.Collections.Generic.IList<System.String>> at tomenglertde.ResXManager.Model.ResourceEntityExtensions.ImportMultipleSheets

Issue appears to be at line 203 of ExcelExtensions-

```
var data = (IList<IList<string>>)rows.Select(row => row.GetCellValues(sharedStrings)).ToArray();
```

Interestingly neither ImportMultipleSheets or the GetCellValues method seem to have changed between 1.0.0.56 and 1.0.0.57
Comments: ** Comment from web user: pwdst **

The statement that code hasn't changed between releases isn't correct - there are multiple commits looking at the history between May 31st and 36059 on June 27th.

Change appears to be introduced in commit 35936.

Previous code-

```
var data = (IList<IList<string>>)rows.Select(row => row.OfType<Cell>().GetRowContent(sharedStrings)).ToArray();
```

Replacement code-

```
var rows = sheet.GetRows(workbookPart);

var data = (IList<IList<string>>)rows.Select(row => row.GetCellValues(sharedStrings)).ToArray();
```

GetRowContent returns IList<string> whereas GetCellValues returns IEnumerable<string>


Viewing all articles
Browse latest Browse all 2435

Trending Articles



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