Intro
This guide will explain the syntax and naming conventions of PowerPointWriter data markers, as well as data marker modifiers which can change how data is imported.
|
---|
Definition
A data marker is a string used as a placeholder for data that will be imported by PowerPointWriter's PowerPointTemplate
object. Each data marker corresponds to a column in a data source. The data markers are added to the template in PowerPoint and then populated at run time using PowerPointTemplate
.
Syntax
Basic Syntax
Data markers use the following syntax: %%=DataSourceName.ColumnName
- DataSourceName is the name of the data source. This name is specified in code when the
PowerPointTemplate.BindData
method is called.
- ColumnName is the name of the column that contains the value(s) to be imported. The column name must match the columns specified in code.
For more information on the types of data sources supported by PowerPointWriter and how to bind data to a template, see Importing a Single Row of Data and Importing Multiple Rows of Data.
Allowed characters
Additionally, the data source name and the column name must follow these rules:
- Data source and column names must not include Unicode characters
- Data source and column names must begin with a letter (A-Z, a-z).
- Data source and column names may include the following characters only:
\ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_ - Spaces are not allowed anywhere in a data marker
To use any Unicode character or spaces in data marker names, enclose the data source name or column name in brackets: %%=[DataSourceName].[ColumnName]
For example: %%=Products.[Sales Person] or %%=[Dat@ $ource].ColumnName
Modifiers
Modifiers can effect how data is imported into the template file. Modifiers use the following syntax: %%=DataSourceName.ColumnName(modifier)
List of modifiers
Modifier |
Behavior |
Additional references |
---|---|---|
Continue |
The continue modifier allows data to be imported onto multiple slides in a presentation. Set DataBindingProperties.MaxRowsPerSlide to limit the number of rows that can be imported on a slide and then use the continue modifier to continue importing the additional rows. |
|
Image |
The image modifier is used to import an image into a presentation. The image modifier has parameters that can control the dimensions and aspect ratio settings of the imported image. |
Additional Resources
For more help getting started with PowerPointWriter see our HelloWorld and Basic tutorials.
Merge Field Formulas
The PowerPointTemplate object evaluates a number of different formulas placed in data markers using the format %%=FORMULA_NAME(DataSource.ColumnName). Each of the formulas will perform a specific operation on the values of the referenced data column. Formulas are evaluated for all values of the column in the data source, regardless of how many of the values are actually displayed in the document.
PowerPointWriter supports the following data marker formulas:
AVERAGE |
Calculates the average of the column values |
---|---|
COUNT |
Returns the number of values (that is, the number of rows in the data source) of the column |
COUNTA |
Returns the number of non-null values of the column |
MAX |
Returns the maximum value from the column |
MIN |
Returns the minimum value from the column |
PRODUCT |
Calculates the product of the column values |
STDEV |
Returns the standard deviation of the column values, treating the values as a sample |
STDEVP |
Returns the standard deviation of the column values, treating the values as a population |
SUM |
Calculates the sum of the column values |
VAR |
Returns the variance of the column values, treating the values as a sample |
VARP |
Returns the variance of the column values, treating the values as a population |