title: EPPLus C# create and write file to stream in junks
body: <p>I am using EPPlus (chosen over openxml). I have a very specific need and battling to find a solution (its odd as I would have assumed that this would be a common requirement!): I am loading lots of rows from SQL server, then creating and xlsx report and then streaming the file to S3. Memory is a scarce resource in my case so I have been challenged to stream the data from SQL server, create the excel file (with some basic formatting) and then copy the file up to S3 - all of this using streaming/chunking - so I can have some control over utilization of memory.</p>
  
  <p>I can stream from sql server no problem, and can stream to S3 no problem, the issue is now creating the xlsx file without having to load the whole object into memory. Most examples look like this:</p>
  
  <pre><code>MemoryStream stream = new MemoryStream();
  using (ExcelPackage package = new ExcelPackage(stream))
  {
      //Here goes the ExcelPackage code etc
      package.Save() or SaveAs etc.
  }
  </code></pre>
  
  <p>The issue with this is that the comment 'Here goes the ExcelPackage code etc' is normally code iterating through a list of data and writing to the file's cells or range of cells.</p>
  
  <p>How can I grab the content of the xlsx file while iterating through the 'list' of data and making sure that epplus inst loading the whole file into memory? On testing a file with 1000000 rows and 10 columns we are around 90MB. I would like to say pull 1000 rows from sql server, write the rows to epplus and then start streaming the ExcelPackage to S3, whilst pulling the next 1000 rows from sql server - wash, rinse, repeat...</p>
  
  <p>I'm also very opposed to hand crafting open xml files :)</p>
  
  <p>thanks.</p>