This project has moved and is read-only. For the latest updates, please go here.

Streaming Excel file

Aug 1, 2014 at 10:06 AM
Edited Aug 1, 2014 at 12:02 PM
Hi, I know that EPPlus can write content to stream, but I need another behavior:
I want to write to stream as part of the excel data is ready. I use BufferOutput = false to write to response immediately, but I don't know what to do with ExcelPackage to make it work.
response.BufferOutput = false;
response.AddHeader("content-disposition", "inline; filename=" + reportGenerator.FileName);
response.ContentType = reportGenerator.ContentType;
I tried to pass response.OutputStream to ExcelPackage but getting error which says that method is not supported. It seems that this is because OutputStream is not writeable as ExcelPackage requires.
What can I do to write Excel content directly to OutputStream as the part of the data is ready?
I don't watn to send entire Excel content using GetAsByteArray or SaveAs methods, I want partial writing to stream.