Excerpt |
Sets a row's An IDictionary
represents a collection of key-and-value pairs. This method sets the data source to an an
Msdn |
---|
| System.Collections.IDictionary |
---|
| System.Collections.IDictionary |
---|
1 | IDictionary |
---|
|
. An IDictionary
represents a collection of key-and-value pairs. for a single row of the template. Only one row of data is returned for the column bound in the data marker. It is important to note you must insert a data marker into the template for every column you want displayed. Signature |
---|
|
public virtual void BindRowData(System.Collections.IDictionary dataSource, System.String dataSourceName, DataBindingProperties property)
|
...
Example |
---|
Code Block |
---|
|
ExcelTemplate xlt = new ExcelTemplate();
xlt.Open(@"C:\ExcelWriter\EmployeeOrdersTemplate.xls");
//--- Bind the IDictionary collection to the
//--- %%=Orders.[Field] data marker.
xlt.BindRowData(OrdersColl,
"Orders",
xlt.CreateDataBindingProperties());
xlt.Process();
xlt.Save(Page.Response, "EmployeeOrders.xls", false);
|
Code Block |
---|
|
Dim xlt As New ExcelTemplate()
xlt.Open("C:\ExcelWriter\EmployeeOrdersTemplate.xls")
'--- Bind the IDictionary collection to the
'--- %%=Orders.[Field] data marker.
xlt.BindRowData(OrdersColl, _
"Orders", _
xlt.CreateDataBindingProperties())
xlt.Process()
xlt.Save(Page.Response, "EmployeeOrders.xls", False)
|
|