Message-ID: <348512563.7759.1711620319409.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_7758_1100147719.1711620319409" ------=_Part_7758_1100147719.1711620319409 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html PowerPointTemplate.BindData(System.Object(,), String(), String, = PowerPointWriter.DataBindingProperties)

PowerPointTemplate.BindData(System.Object(,), String(), String, Pow= erPointWriter.DataBindingProperties)

Description

= =20

Sets a rectangular array of objects as a template data source.

=20
C#
=20
 public void BindData(System.Object[,] arrayData, System.String[] columnNam=
es, System.String dataSourceName, DataBindingProperties property)
=20
=20
vb.net
=20
Public Sub BindData(ByVal arrayData As Object(,), ByVal columnNames As Stri=
ng(), ByVal dataSourceName As String, ByVal [property] As DataBindingProper=
ties)
=20
=20

Parameters

=20
arrayData
A rectangular= array of objects to use as the data source. By default, the first dimensio= n corresponds to row and the second to column (that is, Object[row,column])= .=20
columnNames
The names= of the columns to get from the data source. If the=20 columnNames parameter is null, field binding can only be perfo= rmed by ordinal (for example, %%=3DDSN.#1 or %%=3D$DSN). If=20 columnNames is specified, both ordinal field binding and named= field binding can be used.=20
dataSourceName
The= name of the set of data markers at which to insert the values imported fro= m the data source.=20
property
The=20 DataBind= ingProperties object which contains information about how the data shou= ld be bound to the template.=20
property
The=20 DataBind= ingProperties object which contains information about how the data shou= ld be bound to the template.=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 PowerPointTemplate.CreateDataBindingProperties() as the=20 property value.=20

Exceptions

=20
ArgumentNullExce= ption
=20 BindData will throw this exception if=20 null (C#) or=20 Nothing (VB.NET) is passed to the method.=20
ArgumentException=20

Examples

=20
C#
=20

          PowerPointTemplate pptt =3D new PowerPointTemplate();
          pptt.Open(Page.MapPath("./ArrayBindingTemplate2.xls"));

          //--- Create an array of names and an array of data
          //--- source values and bind the data source to the
          //--- template data markers
          //--- %%=3DTwoDimArray.FirstName
          //--- %%=3DTwoDimArray.LastName
          //--- %%=3DTwoDimArray.Position
          string[,] twoDimNormal =3D {
               {"Nancy", "Davolio", "Sales Manager=
"},
               {"Michael", "Suyama", "HR Represent=
ative"},
               {"Adrian", "King", "IS Support"=
;}
               };
          string[] names =3D {"FirstName", "LastName", =
"Position"};
          pptt.BindData(twoDimNormal,
               names,
               "TwoDimArray",
               pptt.CreateDataBindingProperties());
=20
=20
VB
=20
          Dim pptt As New PowerPointTemplate()
          pptt.Open(Page.MapPath("./ArrayBindingTemplate2.xls"))

          '--- Create an array of names and an array of data
          '--- source values and bind the data source to the
          '--- template data markers
          '--- %%=3DTwoDimArray.FirstName
          '--- %%=3DTwoDimArray.LastName
          '--- %%=3DTwoDimArray.Position
          Dim twoDimNormal(,) As String =3D New String(,){ _
               {"Nancy", "Davolio", "Sales Manager=
"}, _
               {"Michael", "Suyama", "HR Represent=
ative"}, _
               {"Adrian", "King", "IS Support"=
;}}
          Dim names As String() =3D {"FirstName", "LastName&=
quot;, "Position"}
          pptt.BindData(twoDimNormal, _
               names, _
               "TwoDimArray", _
               pptt.CreateDataBindingProperties())
=20
------=_Part_7758_1100147719.1711620319409--