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
Description

Excerpt

If you pass Save an

Msdn
System.Web.HttpResponse
System.Web.HttpResponse
1HttpResponse
object object, WordWriter will stream the generated file to the client. If the user chooses to open (rather than save) the file, it will open in the browser window.

Signature
C#
C#
 public void Save(System.Web.HttpResponse response)
Signature
vb.net
vb.net
Public Sub Save(ByVal response As System.Web.HttpResponse)
Parameters
Param
response
response

The page's HttpResponse object.

Exceptions
Exception
ArgumentNullException
ArgumentNullException

Save will throw this exception if null (C#) or Nothing (VB.NET) is passed to the method.

Remarks

You can call Save more than once for a single instance of WordTemplate. 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
csharp
csharp
titleC#

          ...
          WordTemplate oWW = new WordTemplate();
          oWW.Open(Server.MapPath(@"./StringVarTemplate.doc"));
          oWW.SetDataSource(MyDataTable);
          oWW.Process();
          oWW.Save(Page.Response);
        
Code Block
vb.net
vb.net
titlevb.net

          ...
          Dim oWW As New WordTemplate()
          oWW.Open(Server.MapPath("./StringVarTemplate.doc"))
          oWW.SetDataSource(MyDataTable)
          oWW.Process()
          oWW.Save(Page.Response)