Intro
This guide will explain how to import a single row of values into a PowerPoint presentation using data markers. This assumes a basic understanding of data markers.
Binding Data
PowerPointTemplate has a single method for binding data to the data markers that are located in the template: PowerPointTemplate.BindData
. Depending on the data source type and the number of rows in the data source, PowerPointWriter will either import a single row of data or import multiple rows.
There are several ways to import a single row of data into a presentation:
- Use a single dimensional array
- Use a multi-dimensional data source that only has 1 row of data
- Set the maximum number of rows to import to 1 with the
DataBindingProperties
object
Single Dimensional Arrays
Methods:
[PowerPointTemplate.BindData(Object[],String[],String,DataBindingProperties)]
[PowerPointTemplate.BindData(Object[][],String[],String,DataBindingProperties)]
[PowerPointTemplate.BindData(Object
,
,String[],String,DataBindingProperties)]
Arrays don't have built-in means to store column names. The user must specify the column names in a string array that is passed to PowerPointTemplate.BindData
at run time.
If a multidimensional array (Object[,]
) or a jagged array (Object[][]
) contains multiple rows, PowerPointWriter will import all the rows using built-in repeating behavior. To import a single row of data using a multidimensional or jagged array, the array can only contain a single row of data. For more information about using arrays to import multiple rows of data, please see Importing Multiple Rows of Data.
Examples
One dimensional array:
Other data sources - Setting MaxRowsToImport
MaxRowsToImport is a data binding property that can be used to control how many rows of data to import from the data set. When using data sources other than a single dimensional array, a single row of data can be imported by setting MaxRowsToImport to 1.
For more information about importing data from different data sources see Importing Multiple Rows of Data.