If row has a property set on it (for example "hidden" or a style), but it does not otherwise have any cells in it, the application might run into an infinite loop. The xml will look like this:
<sheetData>
<row r="1" spans="1:2" x14ac:dyDescent="0.35">
<c r="A1"><v>1</v></c>
<c r="B1"><v>2</v></c>
</row>
<row r="2" spans="1:2" s="1" customFormat="1" x14ac:dyDescent="0.35"/>
</sheetData>
The last row has formatting applied, so it is present as an element, but has no cells. This file (when the xml is not formatted) will cause an infinite loop on import.
Exception Message: "Stream does not support seeking."
I was trying to stream an XLSX document directly to a write-only stream when I noticed the XlsxWorkbookExporter implementation (or more precisely the custom ZipArchive implementation) requires the stream to be seekable.
I'd like to have the following style property available in the SpreadStreamProcessing library:
TextRotation
SpreadProcessing has a method, cellValue.GetValueAsString(format), which allows the user to apply excel format on a value and get the result. While in SpreadStreamProcessing one could get the format and the value, there is no way to get their result and this is very inconvenient when the values in question are dates.
Workaround:
foreach (ICellImporter cell in rowImporter.Cells)
{
string value = cell.Value;
var format = cell.Format.NumberFormat;
var cellValueFormat = new CellValueFormat(format);
ICellValue cellValue;
CellValueFormat valueFormat;
CellValueFactory.Create(
value,
worksheet,
new CellIndex(0, 0),
cellValueFormat,
out cellValue,
out valueFormat);
var formattedValue = cellValue.GetResultValueAsString(cellValueFormat);
}