Page tree

Versions Compared

Key

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

ExcerptSets 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
1IDictionary
. 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
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)