Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
610
Infragistics.Documents.Excel.Worksheet.Save Method Generates Exception
posted
After exporting an UltraGrid with a large number of cells, (8 columns, +- 200 000 rows) to
an Infragistics.Documents.Excel.Workbook, using an UltraWinGrid.ExcelExport.UltraGridExcelExporter
the Excel.Workbook.Save(string FileName) method is called which fails with an Exception with the message
"Unable to identify the identity of domain.
The resulting workbook file on disk is only unrecognisable to MS Excel.
Excel returns HRESULT: 0x800A03EC when Excel.Application.Workbooks.Open(String Filename) is executed.
This issue started with Infragistics Build no 2016.2
This issue was not present in Infragistics Build no 2016.1.20161.2033 and earlier
Program Code
------------
Imports Infragistics.Documents
Dim loWorkBook As New Excel.Workbook
Dim loWorkSheet As New Excel.Worksheet
Dim loExporter AS New UltraWinGrid.ExcelExport.UltraGridExcelExporter
loWorkBook.SetCurrentFormat(Excel.WorkbookFormat.Excel2007)
With loWorkBook.Worksheets
 .Clear()
 loWorkSheet = .Add(pcWSName)
End With
loExporter.Export(myUltraGrid, loWorkSheet, 1, 1)
loWorkBook.Save("c:\temp\test.xlsx")

Exception Message
-----------------
System.IO.IsolatedStorage.IsolatedStorageException: Unable to determine the identity of domain.
   at System.IO.IsolatedStorage.IsolatedStorage._GetAccountingInfo(Evidence evidence, Type evidenceType, IsolatedStorageScope fAssmDomApp, Object& oNormalized)
   at System.IO.IsolatedStorage.IsolatedStorage.GetAccountingInfo(Evidence evidence, Type evidenceType, IsolatedStorageScope fAssmDomApp, String& typeName, String& instanceName)
   at System.IO.IsolatedStorage.IsolatedStorage._InitStore(IsolatedStorageScope scope, Evidence domainEv, Type domainEvidenceType, Evidence assemEv, Type assemblyEvidenceType, Evidence appEv, Type appEvidenceType)
   at System.IO.IsolatedStorage.IsolatedStorage.InitStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType)
   at System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType)
   at MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder.GetCurrentStore()
   at MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder..ctor()
   at MS.Internal.IO.Packaging.PackagingUtilities.GetDefaultIsolatedStorageFile()
   at MS.Internal.IO.Packaging.PackagingUtilities.CreateUserScopedIsolatedStorageFileStreamWithRandomName(Int32 retryCount, String& fileName)
   at MS.Internal.IO.Packaging.SparseMemoryStream.EnsureIsolatedStoreStream()
   at MS.Internal.IO.Packaging.SparseMemoryStream.SwitchModeIfNecessary()
   at MS.Internal.IO.Packaging.SparseMemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at MS.Internal.IO.Zip.ZipIOFileItemStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.Compression.DeflateStream.WriteDeflaterOutput(Boolean isAsync)
   at System.IO.Compression.DeflateStream.InternalWrite(Byte[] array, Int32 offset, Int32 count, Boolean isAsync)
   at System.IO.Compression.DeflateStream.Write(Byte[] array, Int32 offset, Int32 count)
   at MS.Internal.IO.Packaging.CompressStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at System.IO.BufferedStream.Flush()
   at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
   at System.IO.StreamWriter.Dispose(Boolean disposing)
   at System.IO.StreamWriter.Close()
   at System.Xml.XmlTextWriter.Close()
   at System.Xml.XmlWriter.Dispose(Boolean disposing)
   at System.Xml.XmlWriter.Dispose()
   at Infragistics.Documents.Core.Async.UsingHelper`1.<Execute>b__b()
   at Infragistics.Documents.Core.WorkItem.WorkItemSync.ExecuteCore(WorkItemScheduler scheduler)
   at Infragistics.Documents.Core.WorkItem.Execute(WorkItemScheduler scheduler)
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at TryThrowExceptionDispatchInfo(Object )
   at Infragistics.Documents.Core.WorkItem.ExceptionInfo.Rethrow()
   at Infragistics.Documents.Core.WorkItem.RethrowIfExceptional()
   at Infragistics.Documents.Core.WorkItem.RunNextWorkItem(WorkItemScheduler scheduler)
   at Infragistics.Documents.Core.WorkItem.Execute(WorkItemScheduler scheduler)
   at Infragistics.Documents.Core.WorkItemScheduler.SynchronousImpl.Execute(WorkItem workItem)
   at Infragistics.Documents.Excel.Workbook.Save(String fileName, WorkbookSaveOptions saveOptions)   at myApplication.clsExportToExcel.ExportToExcel() in myApplication\clsExportToExcel.vb:line 264