Why don't you write the contents of buffer
to a temporary file to generate the XSSFWorkbook
instance and delete the temporary file when you're done?
//Read Book (Template)
var excelTemplate=new ExcelReport(_db,_logger) {TemplateId=FdId.FD1210};
byte [ ] buffer = excelTemplate.GetExcelTemplate();
string tempFilePath=System.IO.Path.GetTempFileName();
System.IO.File.WriteAllBytes(tempFilePath, buffer);
XSSFWorkbook book = new XSSFWorkbook (tempFilePath);
// (Something to Do)
// Delete temporary files when finished
System.IO.File.Delete(tempFilePath);
© 2024 OneMinuteCode. All rights reserved.