...
Introduction
The DataBindingProperties allows customization of how data is imported by PowerPointTemplate. Excerpt
Center | | |||||
---|---|---|---|---|---|---|
|
Definition
...
Excerpt |
---|
...
object controls how data is bound when |
...
the BindData |
...
method is called. DataBindingProperties can control the max rows of data per slide, the max total rows of data imported, and the slide to which the data is bound. |
...
The BindData |
...
method requires a DataBindingProperties object as a parameter. Use the following line of code to create a new DataBindingProperties object. |
Code Block |
---|
DataBindingProperties dataProps = pptt.CreateDataBindingProperties(); |
MaxRowsPerSlide
MaxRowsPerSlide controls how many of rows of data should be imported onto each slide.
Code Block |
---|
//Setting MaxRowsPerSlide dataProps.MaxRowsPerSlide = 5; |
Using MaxRowsPerSlide to fit data on multiple slides
When this property is set, PowerPointWriter will stop importing data when the limit is reached. In order to import all the data in a data source to your presentation, MaxRowsPerSlide should be used with the _Continue_ modifier. The default value is -1 which indicates that all the data in the data source should be imported to a single slide. For more information see Importing Multiple Rows of Data and Fitting Data on to Multiple Slides.
...
MaxRowstoImport
MaxRowsToImport determines how many total rows of data to import into a presentation. PowerPointWriter will stop importing data from the data source when this limit is reached. The default value is -1 which indicates that data will continue to be imported until the end of the data source is reached.
Code Block |
---|
//Setting MaxRowsToImport dataProps.MaxRowstoImport = 10; |
Importing a single row of data with MaxRowsToImport
Setting MaxRowsToImport = 1 will import a single row of data from a data set with multiple rows. For more information see Importing a Single Row of Data.
Slide
Slide controls which slide in a presentation a given data source should be imported into. Slide can be set to the 0-based index of the slide you wish to import data to. The default value is -1 which indicates that the data is not scoped to a particular slide.
Code Block |
---|
dataProps.Slide = 2; |
Using Slide with Slides.CopySlide
Slide allows for data markers across the presentation to have the same name but import from different data sources. When used with the PowerPointApplication method, Slides.CopySlide(PowerPointWriter.Slide, Int), it is easy to programmatically create and populate multiple slides with the same layout.
Example | ||
---|---|---|
The TemplateOur template presentation contains a single slide with 2 data markers. The CodeThe code below uses PowerPointApplication to copy the slide in our template, then passes the presentation to PowerPointTemplate to bind the data.
ResultThe resulsting output is a presentation containing 2 slides with the same layout but different data. |
See the CopySlide sample for an example of using the Slide DataBindingProperty with Slides.CopySlide.