Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

...

Wiki Markup
{description}
{excerpt}If you pass [Save|ExcelTemplate.Save] an {msdn:System.Web.HttpResponse

...

Signature
C#C#
|HttpResponse} object object, ExcelWriter will stream the generated file to the client. {excerpt}
{signature:C#}
 public virtual void Save(System.Web.HttpResponse response)
Signature
{signature}{signature:vb.net
vb.net
}
Public Overridable Sub Save(ByVal response As System.Web.HttpResponse)
Parameters
{signature}

{parameters}
{param:response}A {msdn:System.Http.Response
|System.Http.Response
} object, usually {{Page.Response
.
Param
responseresponseA
Msdn
1System.Http.Response
Exceptions
|ExcelTemplate.Save(System.Web.HttpResponse, String, Boolean)].

You can call {{Save}} more than once for a single instance of [ExcelTemplate]. This allows you to save more than one copy of a generated file, and/or both save the file on the server and stream it to the client. 

{remarks}
{example}{code:csharp|title=C#}

          xlTemplate.Save(Page.Response);
        
{code}
{code:vb.net
|title=vb.net
}

          xlTemplate.Save(Page.Response)
        {code}

{example}
Exception
ArgumentNullExceptionArgumentNullExceptionSave will throw this exception if null (C#) or Nothing
}}.{param}

{exceptions}
{exception:ArgumentNullException}{{Save}} will throw this exception if {{null}} \(C\#\) or {{Nothing}} \(VB.NET\) is passed to the method.
Exception
ArgumentExceptionArgumentException
Remarks
If the user chooses to open (rather than save) the file, it will open in the browser window. ExcelWriter will set a default name for the file. To set a different file name and/or to open the file in Microsoft Excel, use the signature
{exception}
{exception:ArgumentException}{exception}
{remarks}
If the user chooses to open \(rather than save\) the file, it will open in the browser window. ExcelWriter will set a default name for the file. To set a different file name and/or to open the file in Microsoft Excel, use the signature [Save(HttpResponse,string,bool)
.

You can call Save more than once for a single instance of ExcelTemplate. This allows you to save more than one copy of a generated file, and/or both save the file on the server and stream it to the client.

Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle