Table of Contents | ||||
---|---|---|---|---|
|
Setting up the Template
About templates and data markers
An PowerPointWriter template is an PowerPoint presentation that contains PowerPointWriter data markers. A data marker is a line of text beginning with %%=
that specifies a database column, variable, or array to insert into the presentation. PowerPointWriter supports data markers embedded in text. Data markers are added to a presentation in PowerPoint and then bound to data sources in code. PowerPointWriter populates the data markers with values from the data sources when the code is executed.
Data marker syntax
The basic syntax for a data marker is %%=[DataSourceName].[ColumnName]
, where DataSourceName
is the name of the data source and ColumnName
is the name of the column in the data source. You need to follow these rules when naming data markers:
- Names must begin with a letter (A-Z, a-z)
- The brackets (
[
]
) are optional, but must be used when the data marker contains spaces or Unicode characters- The following is a list of characters allowed in data marker names without brackets: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_
- Names must exactly match the names in the data source.
- If a column in a database is 'Street Address', the
ColumnName
must be[Street Address]
to account for the space. Similarly, if a data source name is "DataSource1", the data marker name must beDataSource1
or[DataSource1]
.
- If a column in a database is 'Street Address', the
For more specific information about creating data markers, see How to use Data Markers
Adding data markers to the the template
The final template will look something like this:
{
Excerpt |
---|
The Project Proposal contains information about a new software project, including team members and expected costs. This sample consists of three parts that demonstrate the basics of designing a presentation with PowerPointWriter. By the end of this sample you will be able to create a presentation that takes advantage of the features of both PowerPointTemplate and PowerPointApplication. |
This sample focuses on importing basic text, including multiple rows of data, and using RepeatSlide behavior.
Project Proposal Tutorials:
- Part 1 - Getting Started
- Getting started with data markers, importing data, and setting up a basic template file.
- Part 2 - Repeat Behavior
- Importing data onto multiple slides and passing between the Template and Application objects.
- Part 3 - Passing to PowerPointApplication
- Passing between the Template and Application objects and deleting slides.
Info |
---|
The Project Proposal sample C# code is available for download in PowerPointWriter_Basic_Tutorials.zip |