Insert an Explanation Into an RTF Form Template
To insert an explanation for an attribute into an RTF form template there are several things you need to do:
- In Policy Modeling, add the attribute to the list of explanation attributes available for the form.
- In Word in your template document in the place where you want the explanation to appear, add a field which specifies the attribute to give the explanation on. The code that you use for this field will depend on whether the explanation is only one level deep or multiple levels deep. (The explanation will only be one level deep if relevant attributes have been hidden using silent and invisible parameters to limit the depth of information displayed.) To do this:
- Insert a field into your template.
- Modify the field to have the following code specified in the Advanced tab in the Oracle Analytics Publisher Properties dialog box, where "attribute_name" is replaced by the goal attribute that will be used for the explanation:
- For explanations of one level of depth:
<?for-each:attribute_name/decision-report/attribute-node/attribute-node?><?@text?><?end for-each?> - For explanations of multiple levels of depth:
<?for-each:/global-instance/attribute_name/decision-report/*?><?call-template:decision-report?><?end for-each?>
- For explanations of one level of depth:
- Click OK.
- For explanations of multiple levels of depth, in your template document you also need to add a "decision-report template" field somewhere. This tells Analytics Publisher how to structure and format a multi-level explanation. To do this:
- Insert a field into your template.
- Modify the field to have the following code specified in the Advanced tab in the Oracle Analytics Publisher Properties dialog box:
<?template@inlines:decision-report?> <?if@inlines:"attribute-node"?> <fo:list-block start-indent="{count(ancestor::attribute-node) * 7}mm"> <fo:list-item> <fo:list-item-label> <fo:block>*</fo:block> </fo:list-item-label> <fo:list-item-body> <fo:block><xsl:value-of select="@text"/></fo:block> </fo:list-item-body> </fo:list-item> </fo:list-block> <?for-each@inlines:./attribute-node?><?call-template:decision-report?><?end for-each?> <?end if?> <?end template?> - On the Properties tab of the Oracle Analytics Publisher Properties dialog, change the Text to display setting to be "decision-report template".
- Click OK.
Tip: The Healthy Eating example policy model that is installed with Policy Modeling contains a Raw Template Example RTF file. You can use this file to copy and paste the code for explanations. You just need to replace the attribute identifier (that is, attribute name) in the code, and update the display text as necessary.