Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt

Sets a row's data source to an

Msdn
System.Collections.IDictionary
System.Collections.IDictionary
1IDictionary
. An IDictionary represents a collection of key-and-value pairs.

This method will return only one row of data for the column bound by the datamarker. You

 

When binding an IDictionary horizontally, you must insert a datamarker

into the template

for each

column of data

value you want

shown

displayed.

Signature
C#
C#
public virtual void BindRowData(System.Collections.IDictionary dataSource, System.String dataSourceName, DataBindingProperties property)

...

Example
Code Block
csharp
csharp
titleC#

          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
vb.net
vb.net
titlevb.net

          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)