Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Introducedin
8.5.1
8.5.1
Description

Excerpt

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

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

A

Msdn
System.IO.Stream
System.IO.Stream
1System.IO.Stream
object.

Example
Code Block
csharp
csharp
titleC#
		//--- 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();
		}
	
Code Block
vb.net
vb.net
titlevb.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