Message-ID: <1059189224.8107.1711632154731.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_8106_150963133.1711632154731" ------=_Part_8106_150963133.1711632154731 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
public void BindRowData(System.Data.DataSet da= taSource, System.String dataSourceName, DataBindingProperties property)=20
Public Sub BindRowData(ByVal dataSource As Syste= m.Data.DataSet, ByVal dataSourceName As String, ByVal [property] As DataBin= dingProperties)=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.
BindRowData
will throw this exception if=20
null
(C#) or=20
Nothing
(VB.NET) is passed to the method.=20
Only the first row of the DataSet will be used. This method is commonly = used to create a set of key-value pairs via a single row of data.
You can set several data sources for a single template. Use the followin= g methods to set template data sources: BindCellData, BindColumnData, BindRowData, and Bin= dData.
=20ExcelTemplate xlt =3D new ExcelTemplate(); xlt.Open(@"C:\ExcelWriter\EmployeeOrdersTemplate.xls"); //--- Bind the DataSet to the //--- %%=3DOrders.[Field] data marker. xlt.BindRowData(OrdersDS, "Orders", xlt.CreateDataBindingProperties()); xlt.Process(); xlt.Save(Page.Response, "EmployeeOrders.xls", false);=20
Dim xlt As New ExcelTemplate() xlt.Open("C:\ExcelWriter\EmployeeOrdersTemplate.xls") '--- Bind the DataSet to the '--- %%=3DOrders.[Field] data marker. xlt.BindRowData(OrdersDS, _ "Orders", _ xlt.CreateDataBindingProperties()) xlt.Process() xlt.Save(Page.Response, "EmployeeOrders.xls", False)=20