I have a file with a pivot table. Due to an error in creating the pivot table (See the post previously from me - where it has been acknowledged and sent to the dev team) the workaround is to save the workbook to a memory stream and then load from stream (I wrap it in a using statement to dispose of the memory stream.
I know need to save the workbook to Azure storage and so need it saved to a stream first and then sent to Azure.
If I do this, I get an error the second time as follows:
3/31/2017 8:54:24 PM Specified argument was out of the range of valid values.
Parameter name: iStartPos
stacktrace: at spr1640.0(Int32 A_0, Int32 A_1, Int32 A_2)
at Spire.Xls.Core.Spreadsheet.RichTextString.SetRichTextFont(Int32 iStartPos, Int32 iEndPos, IFont font)
at Spire.Xls.Core.Spreadsheet.RichTextString.SetFont(Int32 startIndex, Int32 endIndex, IFont font)
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.0(Int64 A_0, Boolean A_1, RichTextString A_2, Boolean A_3, Boolean& A_4)
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.0(Int32 A_0, Int32 A_1, Int32 A_2, Boolean A_3)
at Spire.Xls.Core.Spreadsheet.XlsWorksheet.AutofitRow(Int32 rowIndex, Int32 firstColumn, Int32 lastColumn, Boolean bRaiseEvents)
at Spire.Xls.Core.Spreadsheet.XlsWorkbook.SaveAs(Stream stream, ExcelSaveType saveType, ExcelVersion version)
at Spire.Xls.Workbook.SaveToStream(Stream Stream, FileFormat fileFormat)
at Atlas.Toolkit.Utilities.ExcelManager.<CreateScorecardPivot>d__0.MoveNext() in ExcelManager.cs:line 245
line 245 is wb.SaveToStream(me, FileFormat.Version2013);
The strange thing is that if I save it directly to a local file instead (wb.save("documents", FileFormat.Version2013) then it works with no errors.