Page tree
    Created with Raphaël 2.1.0
    Loading...
Skip to end of metadata
Go to start of metadata

Introduced in build 8.5.1

Description

Creates a new System.IO.Stream object and writes the processed template to it.

C#
public virtual Stream SaveToStream()
vb.net
Public Overridable Function SaveToStream() As System.IO.Stream

Returns

A System.IO.Stream object.

Examples

C#
//--- Reads a .xlsx file from disk and saves it to a stream
using (ExcelTemplate xlt = new ExcelTemplate())
{
    xlt.Open(@"C:\temp\example.xlsx");
    xlt.Process();
    Stream stream = xlt.SaveToStream();
}
vb.net
'--- Reads a .xlsx file from disk and saves it to a stream
Using xlt As New ExcelTemplate()
    xlt.Open("c:\temp\example.xlsx")
    xlt.Process()
    Dim stream As System.IO.Stream() = xlt.SaveToStream();
End Using
  • No labels