Message-ID: <1297752651.7843.1711623913323.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_7842_1509972750.1711623913323" ------=_Part_7842_1509972750.1711623913323 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
public void BindData(System.Collections.Generi= c.IEnumerable<T> dataSource, System.String dataSourceName, DataBindin= gProperties property)=20
Public Sub BindData(ByVal dataSource As System.C= ollections.Generic.IEnumerable(Of T), ByVal dataSourceName As String, ByVal= [property] As DataBindingProperties)=20
dataSourceName
must be specified, but can be left as null or a=
n empty string if this is the first data source bound AND the data markers =
in the template use the=20
short da=
ta marker syntax or refer to the datasource by number rather than name.=
Note:=20
dataSourceName
does not include a data marker's column name, f=
or example, the=20
dataSourceName
for=20
%%=3DProducts.ProductID
is "Products."=20
property
Must be specified, but the=20
DataBindingProperties
need not be set beforehand. To bind data=
to a template with the default=20
DataBindingProperties
, pass in=20
ExcelTemplate.CreateDataBindingProperties()
as the=20
property
value. Otherwise, use the=20
ExcelTemplate.CreateDataBindingProperties()
method to generate=
a new=20
DataBindingProperties
object and set the=20
Dat=
aBindingProperties.MaxRows,=20
D=
ataBindingProperties.Transpose, and/or=20
DataBindingProperties.WorksheetName properties for the workbook.
BindData
will throw this exception if=20
null
(C#) or=20
Nothing
(VB.NET) is passed to the method.=20
BindData
will throw this exception if the data source contains=
more rows than the worksheet can hold.
ExcelTemplate xlt =3D new ExcelTemplate(); interface IOrder { int OrderID; string Customer; DateTime OrderDate; float OrdersTotal; } IEnumerable<IOrder> orders =3D GetOrders(); xlt.BindData(orders, "Orders", xlt.CreateDataImportProp= erties());=20
Dim xlt As New ExcelTemplate() Interface IOrder Property OrderID() as Int32 Property Customer() as String Property OrderDate() as DateTime Property OrdersTotal() as Single End Interface Dim orders as IEnumerable(Of Order) =3D GetOrders() xlt.BindData(orders, "Orders", xlt.CreateDataImportProp= erties())=20