sergey-tihon / Clippit

Fresh PowerTools for OpenXml
https://sergey-tihon.github.io/Clippit/
MIT License
50 stars 19 forks source link

SpreadsheetWriter should be able write directly to MemoryStream #26

Closed sergey-tihon closed 3 years ago

sergey-tihon commented 3 years ago

In-memory Excel generation should be possible.

Currently it is possible only using file system

var filePath = Path.GetTempFileName();
try
{
    SpreadsheetWriter.Write(filePath, wb);
    return new MemoryStream(File.ReadAllBytes(filePath));
}
finally
{
    if (File.Exists(filePath))
        File.Delete(filePath);
}