SetRuntimeProperties method: ReportDefn class

Syntax

SetRuntimeProperties(&NameArray, &ValueArray)

Description

Use the SetRuntimeProperties method to set additional runtime values and properties required for generating this report.

Note:

BI Publisher's properties are defined at three different levels. Global properties are defined on the Global Properties page, and system properties are defined in the xdo.cfg file. At the report definition level, properties are defined on the Report Definition - Properties page. The runtime properties defined using this method override both global and report definition properties. However, system properties defined in the xdo.cfg file cannot be overridden using this method.

Parameters

Parameter Description

&NameArray

Specify an already instantiated and populated array of string containing the names of the additional properties or variables that you need for this report.

&ValueArray

Specify an already instantiated and populated array of string containing the values of the additional properties or variables that you need for this report. The values should be in the same order as the names listed in &NameArray.

Returns

None.

Example

The following example sets extra parameters for securing a document.

&asPropName = CreateArrayRept("", 0);
&asPropValue = CreateArrayRept("", 0);
&asPropName.Push("pdf-compression");
&asPropValue.Push("false");
&asPropName.Push("pdf-hide-menubar");
&asPropValue.Push("true");
&oRptDefn.SetRuntimeProperties(&asPropName, &asPropValue);

Setting Custom Runtime Parameters

The SetRuntimeProperties method can also be used to set custom runtime parameters. When setting custom runtime parameters with the SetRuntimeProperties method, the parameter names need to be prefixed with xslt, and the values need to be surrounded by single quotes (for example, 'xyz'). For example, the following code creates a custom runtime parameter named xslt.ReportOwner:

&asPropName = CreateArrayRept("", 0);
&asPropValue = CreateArrayRept("", 0);
&asPropName.Push("xslt.ReportOwner");

/* Note the single quotes around the parameter value */
&asPropValue.Push(" 'John Smith' ");

&oRptDefn.SetRuntimeProperties(&asPropName, &asPropValue);

The custom parameter may now be used in the template via the tag <?$ReportOwner?>. Before using it, it does need to be declared in a form field on the report template using the following tag:

<xsl:param name="ReportOwner" xdofo:ctx="begin"/>