Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

Description

Excerpt

Creates a DataBindingProperties object for assigning the property values associated with one or more data binding calls.

Signature
C#
C#
 public virtual DataBindingProperties CreateDataBindingProperties()
{signature}
{signature:
}
Signature
vb.net
vb.net
Public Overridable Function CreateDataBindingProperties() As DataBindingProperties
{signature}
{exceptions}
{exception:ArgumentNullException}{{CreateDataBindingProperties}} will throw this exception if {{null}} \(C\#\) or {{Nothing}} \
Exceptions
Exception
ArgumentNullException
ArgumentNullException

CreateDataBindingProperties will throw this exception if null (C#) or Nothing (VB.NET

\

)

is

passed

to

the

method.

{exception} {exception:ArgumentException} {exception} {remarks}A {{DataBindingProperties}} object is required for each data binding call, including these methods: [BindData|ExcelTemplate.BindData], [BindCellData|ExcelTemplate.BindCellData(Object, String, DataBindingProperties)], [BindColumnData|ExcelTemplate.BindColumnData], and [BindRowData|ExcelTemplate.BindRowData]. Hence, [CreateDataBindingProperties|ExcelTemplate.CreateDataBindingProperties()] must be called at least once in any WordTemplate project that binds data to a template. The same {{DataBindingProperties}} object can be used for multiple data binding method calls. {remarks} {example}{code:csharp|title=C#}

Exception
ArgumentException
ArgumentException

Remarks

A DataBindingProperties object is required for each data binding call, including these methods: BindData, BindCellData, BindColumnData, and BindRowData. Hence, CreateDataBindingProperties must be called at least once in any WordTemplate project that binds data to a template.

The same DataBindingProperties object can be used for multiple data binding method calls.

Example
Code Block
csharp
csharp
titleC#


          //--- Create a DataBindingProperties object to be used
          //--- in a data binding call
          DataBindingProperties dbp = ExcelTemplate.CreateDataBindingProperties();
          dbp.MaxRows = 20;
          xlt.BindData(twodim, names, "TwoDimArray", dbp);
          xlt.Process();
          xlt.Save(Page.Response, "output.xls", false);
        
{code} {code:
Code Block
vb.net
|title=
vb.net
titlevb.net
}


          '--- Create a DataBindingProperties object to be used
          '--- multiple times in a project
          Dim dbp As DataBindingProperties = ExcelTemplate.CreateDataBindingProperties()
          dbp.MaxRows = 20
          xlt.BindData(twodim, names, "TwoDimArray", dbp)
          xlt.Process()
          xlt.Save(Page.Response, "output.xls", False)
        
{code} {example}