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
Wiki Markup
{introducedin: 8.5.1}

{description}
	{excerpt}
		Creates a new System.IO.Stream object and writes the processed template to it.
	{excerpt}

	{signature:C#}
		public virtual Stream SaveToStream()
	{signature}

	{signature:vb.net}
		Public Overridable Function SaveToStream() As System.IO.Stream
	{signature}

{returns}
	A {msdn:System.IO.Stream|System.IO.Stream} object.
{returns}

{example}
	{code:csharp|title=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();
		}
	{code}
	{code:vb.net|title=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
	{code}
{example}