Dear Stackoverflow community.
Development Platform: .NET 2.0 Platform: ASP.NET Spreadsheetgear: 2008 Language: C#
Is there a way to retrieve the Length in bytes of a workbook without copying it/saving it to another object?
I went through the documentation and several attempts with no success.
I am saving the workbook by using the SaveToStream method which is writing the workbook directly to the Page.Response.OutputStream which then is flushed out of the browser. But since the type of this object is Stream, this abstract class doesn't implement the Length property and casting it to a child class like MemoryStream will return null. In both cases the app will throw an Exception.
I need to capture the length in bytes in order to log it for performance review purposes in our application.
My purpose is to avoid copying that Stream to another object and if possible using only reference casts because we need to optimize the memory footprint of the module that exports to Excel spreadsheets in out application.
Thanks a lot in Advance. Einar.