An account statement is sent out to customers in three countries. The Document Designer wants a different address definition for recipients in each country. The address definition differs in format for the different countries and contains dynamic information that is different for each recipient.
The document designer realizes that these address definition will possibly be used in other documents than this account statement. So, a StoryTeller document called
AddressDefinitionFragments.ssd with three page definitions is created as a resource in the resource set. On each page definition, the designer designs the different address definitions with dynamic substitutions for the address. She renames all three page definitions
English,
French,
German. These three page definitions can later be re-used as Fragments that are dynamic because of the address definitions included.
On the first page definition, she adds the Fragment by right-clicking the page and then selects
Insert >
Fragment >
Dynamic. She clicks
Resources in the Insert Fragment dialog and browses to the
AddressDefinitionFragments.ssd file and selects it.
In the Properties panel, Fragment category, she selects the Name property. In the Modification field, she browses to a field in the Message that determines which Fragment to use for each recipient. In this case there is a
language field which has values that normally are English, French, and German. If any other value is issued in the input data, the default is used.
Depending on the value of the language field in the Message, a different address definition is rendered on a specific document instance. If the language field is empty, the version selected during design-time is selected, or, if none was selected, the first one in the Pages list of the source document. If the language field has a value that has no corresponding fragment, there is an error.