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

ExcelTemplate

Description

=20

The ExcelTemplate object repr= esents an ExcelWriter template spreadsheet.

=20
C#
=20
public class ExcelTemplate
=20
=20
vb.net
=20
Public Class ExcelTemplate
=20
=20

Remarks

=20

An ExcelWriter template is a file created in Microsoft Excel that contai= ns data markers.

=20

A data marker specifies a database column, variable, or array to insert = in the spreadsheet column containing the marker.

=20

The ExcelTemplate object is in the SoftArtisans.Offic= eWriter.ExcelWriter namespace. The object can be referenced as SoftArtisans.OfficeWriter.ExcelWriter.ExcelTemplate. To minimize ty= ping and errors, use an Import directive to import the namespa= ce to the aspx page, and reference the object as ExcelTemplate= , without the namespace prefix.

=20

Examples

=20

If you are coding directly in the .aspx page, following the Page directi= ve, include:

=20
=20
<%@ Import Namespace=3D"SoftArtisans.OfficeWriter.ExcelWriter"=
 %>
=20
=20

If you are coding in the "code behind" page (.aspx.vb or .aspx= .cs), include an Imports or using statement at th= e top of the "code behind" page:

=20
C#
=20
using SoftArtisans.OfficeWriter.ExcelWriter;
=20
=20
vb.net
=20
Imports SoftArtisans.OfficeWriter.ExcelWriter
=20
=20

To create an instance of the ExcelTemplate object use:

= =20
C#
=20
ExcelTemplate oExcelTemplate =3D new ExcelTemplate();
=20
=20
vb.net
=20
Dim oExcelTemplate As New ExcelTemplate()
=20
=20

Fields

=20
=20 =20 =20 =20 =20

ALL_ROWS

Used as DataBindingProperties.MaxRows, to indicate that as m= uch of the data source should be imported as possible.

=20

Properties

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 = =20 =20

Name

Description

ContentType

Sets or returns the generated spreadsheet's MIM= E content type.

DecryptPassword

To decrypt an encrypted template, set DecryptPassword to the = password set using E= ncryptPassword or in Microsoft Excel (Tools -> Options... -> Secu= rity).

EncryptPassword

If you set EncryptPassword, ExcelWriter will encrypt the genera= ted spreadsheet - when = Process is called - using RC4 encryption.

ExcludeMacros

Sets whether ExcelWriter should remove template= macros from the generated spreadsheet or include them.

LicenseKey

Sets or returns the 23-character license key th= at enables ExcelWriter for the current instance.

PreserveStrings

If you set PreserveStrings to true, ExcelWriter wi= ll preserve numeric strings as strings.

RemoveExtraDataMarkers

Sets whether ExcelWriter should remove data mar= kers in the template that do not bind to data sources in code.

StretchCellReferencesInCharts

Sets or returns whether to stretch cell referen= ces in charts.

Version

Returns the exact version of ExcelWriter.
=20

Methods

=20
=20 =20 =20 =20 =20 =20 = =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

BindCellData(Object, String, DataBindingProperties)

Sets an object as a data source for a single ce= ll in a template.

BindColumnData(Object(), String, DataBindingProperties)

=20
Sets an array of objects as a data source for a= single column in the template.

BindColumnData(System.Collections.IDictionary, String, DataBindingP= roperties)

Sets a column's data source to an IDictionary. An IDictionary represents a collection of key-and-value pairs.

BindColumnData(System.Collections.IEnumerable, String, DataBindingP= roperties)

Sets a column's data source to an IEnumerable collection. The IEnu= merable interface supports a simple iteration over a collection. =20

BindData(Object()(), String(), String, DataBindingProperties) <= /p>

Sets a two-dimensional - possibly jagged - arra= y of objects as a template data source.

BindData(Object(,), String(), String, DataBindingProperties)

Sets a rectangular array of objects as a templa= te data source.

BindData(System.Data.IDataReader, String, DataBindingProperties)

Sets an ADO.NET IDataReader as a data source to= bind to template data markers.

BindData(System.Data.DataSet, String, DataBindingProperties)

Sets an ADO.NET DataSet as a data source to bin= d to template data markers.

BindData(System.Data.DataTable, String, DataBindingProperties) =

Sets an ADO.NET DataTable as a data source to b= ind to template data markers.

BindRowData(Object(), String(), String, DataBindingProperties) =

Sets an array of objects as a data source for a= single row in a template.?  When binding an array horizontally, you&n= bsp;must insert a datamarker for each element you want displayed.   =20

BindRowData(System.Collections.IDictionary, String, DataBindingProp= erties)

Sets a row's data source to an IDictionary. An IDictionary = represents a collection of key-and-value pairs.  

When binding an I= Dictionary horizontally, you must insert a datamarker for each value you wa= nt displayed.

BindRowData(System.Collections.IEnumerable, String(), String, DataB= indingProperties)

Sets a row's data source to an IEnumerable collection. The IEnumer= able interface supports a simple iteration over a collection.
= This method will return only one row of data for the column bound by the da= tamarker. You must insert a datamarker into the template for each column of= data you want shown.

BindRowData(System.Data.DataSet, String, DataBindingProperties)=

Sets a DataSet as a data source to bind to a ro= w in the template.   This method will import only the first row of the= first DataTable of the DataSet.   You must insert a datamarker i= nto the template for each column of data you want shown.

BindRowData(System.Data.DataTable, String, DataBindingProperties)

Sets a DataTable as a data source to bind to a = row in the template. This method will import only the first row of the Data= Table.  You must insert a datamarker into the template for each column= of data you want shown.

BindRowData(System.Data.DataView, String, DataBindingProperties)

Sets a DataView as a data source to bind to a r= ow in the template.  This method will import only the first row of the= DataView.  You must insert a datamarker into the template for each co= lumn of data you want shown.

CreateDataBindingProperties()

Creates a DataBindingProperties object for assigning the property value= s associated with one or more data binding calls.

ExcelTemplate()

Creates a new ExcelTemplate object.

Open(ExcelApplication, Workbook)

Passes a spreadsheet from ExcelApplication to ExcelTemplate.

Open(String)

Opens an ExcelWriter template spreadsheet. A te= mplate is a file created in Microsoft Excel that contains data markers wher= e data source values will be inserted.

Open(System.IO.Stream)

Opens an ExcelWriter template from a System.IO.Stream. An ExcelWriter te= mplate is a file created in Microsoft Excel that contains data markers wher= e data source values will be inserted.

Process()

The Process method enters data source values in a template's data = markers, and creates the output file (the new spreadsheet) in memory. The <= a href=3D"/display/EW8/ExcelTemplate.Save">Save method can then save th= e output file to disk, stream it to the browser, or both.

Save(String)

Saves the generated Excel file on the server. T= he ASPNET account (IIS5), NETWORK SERVICE account (IIS6 or IIS7), or the au= thenticated user must have Write access to the destination directory specif= ied by the outputFileName parameter.

Save(System.IO.Stream)

Generates an Excel binary file and streams it t= o the specified System.IO.Stream or, a class derived from System.IO.Stream (for example= , System.IO.FileStream). = If you pass Save a Sy= stem.IO.FileStream, ExcelWriter will save the generated file on the = server. If you pass Save Response.OutputStream, E= xcelWriter will stream the the generated file to the client.

Save(System.Web.HttpResponse)

If you pass Save an HttpResponse<= /tt> object object, ExcelWriter will stream the generated file to the c= lient.

Save(System.Web.HttpResponse, String, Boolean)

If you pass Save an HttpResponse object, ExcelWriter will stream the gener= ated file to the client. This method allows you to specify a default client= -side file name, and whether the file should be opened in the browser windo= w or in Microsoft Excel.

SetCellDa= taSource(Object, String)

The page ExcelTemplate.SetCellDataSource(Object= , String) could not be found.

SetColumn= DataSource(Object(), String)

The page ExcelTemplate.SetColumnDataSource(Obje= ct(), String) could not be found.

SetColumn= DataSource(Object(), String, Int32)

The page ExcelTemplate.SetColumnDataSource(Obje= ct(), String, Int32) could not be found.

SetColumn= DataSource(System.Collections.IDictionary, String)

The page ExcelTemplate.SetColumnDataSource(Syst= em.Collections.IDictionary, String) could not be found.

SetColumn= DataSource(System.Collections.IDictionary, String, Int32)

The page ExcelTemplate.SetColumnDataSource(Syst= em.Collections.IDictionary, String, Int32) could not be found.

SetColumn= DataSource(System.Collections.IEnumerable, String)

The page ExcelTemplate.SetColumnDataSource(Syst= em.Collections.IEnumerable, String) could not be found.

SetColumn= DataSource(System.Collections.IEnumerable, String, Int32)

The page ExcelTemplate.SetColumnDataSource(Syst= em.Collections.IEnumerable, String, Int32) could not be found.

SetDataSo= urce(Object()(), String(), String)

The page ExcelTemplate.SetDataSource(Object()()= , String(), String) could not be found.

SetDataSo= urce(Object()(), String(), String, Int32, Boolean)

The page ExcelTemplate.SetDataSource(Object()()= , String(), String, Int32, Boolean) could not be found.

SetDataSo= urce(Object(,), String(), String)

The page ExcelTemplate.SetDataSource(Object(,),= String(), String) could not be found.

SetDataSo= urce(Object(,), String(), String, Int32, Boolean)

The page ExcelTemplate.SetDataSource(Object(,),= String(), String, Int32, Boolean) could not be found.

SetDataSo= urce(System.Data.IDataReader, String)

The page ExcelTemplate.SetDataSource(System.Dat= a.IDataReader, String) could not be found.

SetDataSo= urce(System.Data.IDataReader, String, Int32)

The page ExcelTemplate.SetDataSource(System.Dat= a.IDataReader, String, Int32) could not be found.

SetDataSo= urce(System.Data.DataSet, String)

The page ExcelTemplate.SetDataSource(System.Dat= a.DataSet, String) could not be found.

SetDataSo= urce(System.Data.DataSet, String, Int32)

The page ExcelTemplate.SetDataSource(System.Dat= a.DataSet, String, Int32) could not be found.

SetDataSo= urce(System.Data.DataTable, String)

The page ExcelTemplate.SetDataSource(System.Dat= a.DataTable, String) could not be found.

SetDataSo= urce(System.Data.DataTable, String, Int32)

The page ExcelTemplate.SetDataSource(System.Dat= a.DataTable, String, Int32) could not be found.

SetRowDat= aSource(Object(), String(), String)

The page ExcelTemplate.SetRowDataSource(Object(= ), String(), String) could not be found.

SetRowDat= aSource(System.Collections.IDictionary, String)

The page ExcelTemplate.SetRowDataSource(System.= Collections.IDictionary, String) could not be found.

SetRowDat= aSource(System.Collections.IEnumerable, String(), String)

The page ExcelTemplate.SetRowDataSource(System.= Collections.IEnumerable, String(), String) could not be found.

SetRowDat= aSource(System.Data.DataSet, String)

The page ExcelTemplate.SetRowDataSource(System.= Data.DataSet, String) could not be found.

SetRowDat= aSource(System.Data.DataTable, String)

The page ExcelTemplate.SetRowDataSource(System.= Data.DataTable, String) could not be found.

SetRowDat= aSource(System.Data.DataView, String)

The page ExcelTemplate.SetRowDataSource(System.= Data.DataView, String) could not be found.
=20

Extension Methods

=20

I= ntroduced in build 7.5

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20

Name

Description

BindData(Microsoft.SharePoint.SPView, Microsoft.SharePoint.SPList, S= tring, DataBindingProperties)

Sets a SharePoint View as a template data source= .

BindData(Microsoft.SharePoint.SPList, String, DataBindingProperties)=

Sets a SharePoint List as a template data source= .

BindRowData(Microsoft.SharePoint.SPView, Microsoft.SharePoint.SPList= , String, DataBindingProperties)

Sets a SharePoint View as a data source for a si= ngle row in a template.

BindRowData(Microsoft.SharePoint.SPList, String, DataBindingProperti= es)

Sets a SharePoint List as a data source for a si= ngle row in a template.

Open(Microsoft.SharePoint.SPDocumentLibrary, String)

Opens a spreadsheet from a SharePoint Document L= ibrary.

Open(Microsoft.SharePoint.SPListItem, String)

Opens a spreadsheet from a SharePoint List Item.=

Save(Microsoft.SharePoint.SPDocumentLibrary, String, Boolean)

Generates an Excel binary or OOXML file and save= s it to a SharePoint Document Library.

Save(Microsoft.SharePoint.SPListItem, String)

Generates an Excel binary or OOXML file and save= s it as an attachment to a SharePoint list item.
------=_Part_9574_1939461528.1711695439509--