Message-ID: <2128518759.9057.1711674670170.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9056_2017537206.1711674670170" ------=_Part_9056_2017537206.1711674670170 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html ExcelTemplate.Save(String)

ExcelTemplate.Save(String)

Description

= =20

Saves the generated Excel file on the server. The ASPNET account (IIS5),= NETWORK SERVICE account (IIS6 or IIS7), or the authenticated user must hav= e Write access to the destination directory specified by the outputFi= leName parameter.

=20
C#
=20
 public virtual void Save(System.String fileName)
=20
=20
vb.net
=20
Public Overridable Sub Save(ByVal fileName As String)
=20
=20

Parameters

=20
outputFileName
Sp= ecifies a complete path and file name for the generated file. ExcelWriter w= ill save the file to this location. If a file with the same name exists, it= will be overwritten by the new Excel file.=20

Exceptions

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

Remarks

=20

ExcelWriter allows you to save in both the Excel 97-03 BIFF8 format (.xl= s) or the new Office Open XML (.xlsx) format. The template file must be of = the expected output format. Hence, if you wish to output .xls files, you mu= st start with a .xls template, and if you wish to output .xlsx files, you m= ust start with a .xlsx template. ExcelWriter does not support the creation = or editing of .xlsx files with the ExcelApplication object.

=20

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

=20

Examples

=20
C#
=20

          //--- Save a .xls file
          xlTemplate.Save(@"C:\Reports\Orders.xls");

          //--- Save a .xlsx file
          xlTemplate.Save(@"C:\Reports\Orders.xlsx");
        
=20
=20
vb.net
=20

          '--- Save a .xls file
          xlTemplate.Save("c:\Reports\Orders.xls")

          '--- Save a .xlsx file
          xlTemplate.Save("c:\Reports\Orders.xlsx")
        
=20
------=_Part_9056_2017537206.1711674670170--