locked
ReportViewer ITemporaryStorage implementation for Web Forms RRS feed

  • Question

  • User1618900539 posted

    Hi!

    I have a question about the implementation of a custom temporary storage type for Report using Web Forms:

    If I have a simple class like the following,

       Public Class ReportsTemporaryStorage
          Implements ITemporaryStorage

          Public Function CreateTemporaryStream() As System.IO.Stream Implements Microsoft.Reporting.WebForms.ITemporaryStorage.CreateTemporaryStream
                Dim ms As New IO.MemoryStream
                Return ms
          End Function

       End Class

    Does anybody know how the ReportViewer disposes the Stream after it ended using it?

    Because using MemProfiler I found that the MemoryStreams are left undisposed, thus I'm wondering if it's doing it correctly...

     

    Cheers,

     
     

    Monday, September 3, 2007 8:06 PM

All replies

  • User806833803 posted

    Try using BufferedStream if you are concerned about disposing memory.

     

     public Stream CreateTemporaryStream()
            {
                string fullPath = Path.GetTempFileName();      
                Stream sm = File.Create(fullPath);
                BufferedStream stream = new BufferedStream(sm);
                return stream;
            }
    Tuesday, September 20, 2011 2:08 AM