Introduction
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.
Sytax
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
Ordinal Syntax
Data markers can also be defined using *ordinal syntax*, which allows you to specify the data source and column names using numbers. This gives you flexibility if you don't know the names of your data columns or if you want to generalize a template.
Ordinal syntax is as follows: %%=<DataSourceNumber>.<ColNumber> where:
DataSourceNumber is a 1-based number that is determined by the order of the BindData method calls in the code. For example, %%=#2.#7 refers to the data source associated with the second call to BindData.
ColNumber is a 1-based number that is determined by the order of the columns in the data source. For example, %%=#2.#7 refers to the 7th column in the second data source defined in the code.
Ordinal syntax can be used with regular syntax:
%%=DataSource.#2
%%=#3.ColName
See the fieldname modifier below for more about importing column names with ordinal syntax.
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. | |
Image | The image modifier is used to import an image into a presentation. The image modifier has | |
Fieldname | The *fieldname* modifier will import the column name from the data source, rather than the | See ordinal syntax above. |