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
Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    I created a small sample project based on your code. My grid actually has 15 columns (with a variety of data type) and 200,000 rows. And I am able to run the application and export the grid to Excel successful with no Exceptions.

    Please try my sample and see if the exception occurs with my sample.

    If you get the same exception with my sample (and I don't) then that would indicate this is an issue with the versions of the Infragistics or other assemblies on your machine. I am testing with our latest internal build so if it works fine for me and not you, I recommend that you try getting the latest service release and see if that fixes the problem.

    If you do not get the exception with my sample, then it means something else in your application is causing this. Perhaps you are using a particular data type of some feature of the grid that I am not. So we would need to narrow that down.

    Also, if you can, I recommend trying this with fewer rows, just as a test to see if the number of rows is relevant to the issue. It takes a long time to export so many rows, and testing and debugging will go a lot faster if you can reduce the time it takes to test.

    Finally, I'd be interested to know if the location to which you are saving matters. The Temp folder might be protected by Windows, so you might try saving somewhere else, like to a non-system folder and see if that makes a difference.

    WindowsApplication3.zip
Children