You can use variables in your templates in a variety of ways. For example:
- You want the user (that is generating the document) to specify a value for a variable, in order to customize the output of the document. Learn more about Parameterized Document Generation see the Options and Parameters article.
- You want to retrieve the value of a specified data item (node) from your data source and store the result in a newly created variable for later use. For more information, see the Query tag article.
- You want to improve the maintainability of your template by reusing a value (or expression) throughout your template instead of hard-coding it numerous times. For more information, see the Set tag article.
Parameterized Document Generation
Storyteller supports the use of parameters when you export an office document. Once configured, the user that exports the artifacts can specify their desired parameter values as input. This allows for the behavior of the report to be different based on end-user considerations as opposed to pre-defined thinking by the template developer.
The project administrator can explicitly set up the parameters in the same location where the document template is uploaded to Storyteller. Default values can be assigned to any parameter. Parameters can be configured to be either mandatory or optional.
When a user exports an office document in Storyteller, a screen called 'Specify Parameters' appears in the Generate Office Document wizard. If there are no parameters, or if the parameters are disabled in the project admin console, the wizard screen is automatically skipped.
Ahmed, a template developer, has been asked to create a template that will display all of the requirements of a specific priority level (Low, Medium, and High).
Instead of creating 3 different templates, he creates a template with a parameter called Priority.
Whenever a user generates a document, Blueprint prompts the user to specify a value for the Priority parameter.