Page tree
Skip to end of metadata
Go to start of metadata

The PowerPointTemplate object supports some basic formulas. Each of the formulas will perform a specific operation on the values referenced. 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.

To Use

The formula must follow the syntax %%=FORMULA_NAME(DataSource.ColumnName) where:

  • FORMULA_NAME is one of the formulas listed below

  • 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) that will be used in the calculation. The column name must match the columns specified in code.

There must be a call to PowerPointTemplate.BindData to bind a data source to the template, however, you do not need to include a full data marker (%%=DataSource.ColumnName) in the template to use the formula.

Supported Formulas

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

Examples

$body

The Template

The example below uses formulas to display the average, standard deviation, maximum, and minimum college entrance exam scores of a group of fictional students as part of a table including their individual scores.

The Code

The following code opens the template and binds data to it using the SetDataSource and SetRepeatBlock methods, then streams the resulting document to the user:

Results

The formulas are evaluated by PowerPointTemplate, as you can see in the sample output slide:

Examples

$body
  • No labels