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
300
DataPresenterExcelExporter - Can not access a closed stream error
posted

Hi, Using DataPresenterExcelExporter in 12.1 and throwing an exception when the datapresenter has more than ~136k records.

We're using the ExportAsync Method and when we hit the 136k area, we hit the below exception (tried multiple times and always this area). It's fine exporting 80k records (all attempts are xlsx format). Total data attempting to export is around 200k rows, 25 columns. Is this a known issue?

System.ObjectDisposedException: Can not access a closed Stream.
at System.IO.Compression.DeflateStream.EnsureNotDisposed()
at System.IO.Compression.DeflateStream.Flush()
at MS.Internal.IO.Packaging.CompressStream.Flush()
at MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Flush()
at MS.Internal.IO.Zip.ZipIOLocalFileBlock.FlushExposedStreams()
at MS.Internal.IO.Zip.ZipIOLocalFileBlock.UpdateReferences(Boolean closingFlag)
at MS.Internal.IO.Zip.ZipIOBlockManager.SaveContainer(Boolean closingFlag)
at MS.Internal.IO.Zip.ZipIOBlockManager.SaveStream(ZipIOLocalFileBlock blockRequestingFlush, Boolean closingFlag)
at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.IO.Packaging.PackagePart.Close()
at System.IO.Packaging.Package.DoClose(PackagePart p)
at System.IO.Packaging.Package.DoOperationOnEachPart(PartOperation operation)
at System.IO.Packaging.Package.System.IDisposable.Dispose()
at Infragistics.Documents.Excel.PackageWrapper.Dispose()
at Infragistics.Documents.Excel.Serialization.Excel2007.Excel2007WorkbookSerializationManager.Dispose(Boolean disposing)
at Infragistics.Documents.Excel.Serialization.WorkbookSerializationManager.System.IDisposable.Dispose()
at Infragistics.Documents.Excel.Workbook.SaveXLSXFile(Stream stream, IPackageFactory packageFactory)
at Infragistics.Documents.Excel.Workbook.SaveHelper(Stream stream, IPackageFactory packageFactory)
at Infragistics.Documents.Excel.Workbook.Save(String fileName, IPackageFactory packageFactory)
at Infragistics.Documents.Excel.Workbook.Save(String fileName)
at Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporter.EndExportInternal(DataPresenterExcelExporterHelper exporterHelper, RecordExportCancellationInfo cancelInfo)
at Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporterHelper.EndExport(RecordExportCancellationInfo cancelInfo)
at Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporterHelper.Infragistics.Windows.DataPresenter.IDataPresenterExporterAsync.CancelExport(RecordExportCancellationInfo cancelInfo)
at Infragistics.Windows.DataPresenter.ExportHelper.ExportRequest.CancelExport(RecordExportCancellationReason reason, Exception exception)
at Infragistics.Windows.DataPresenter.ExportHelper.ProcessAsyncExportBlock(ExportRequest request)
at Infragistics.Windows.DataPresenter.ExportHelper.ProcessAsyncExportBlock()
at Infragistics.Windows.DataPresenter.ExportHelper.OnAsyncTimerTick(Object sender, EventArgs e)
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

Parents
No Data
Reply
  • 138253
    Offline posted

    Hello Barry,

    Thank you for your post. I have been looking into it and I created a sample project for you following your scenario and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation. I tested the same with both the RTM (12.1_20121.1010) and latest Service Release(12.1_20121.2169) of 12.1.

    Looking forward for your reply.

    ExcelExporter.zip
Children