Overview
The Template Task is an SSIS Control Flow task for generation of text documents like XML, EDI, HTML, CSV, etc. The setup is done in two steps:
- Definition of template. The template definition is processed by an engine based on the Apache Velocity project.
- Connection of template parameters to files, SSIS variables and data flow destinations.
Template Editor
When you press the ... button on the Template parameter, you enter the Template Editor Dialog.
The dialog contains a syntax-highlighting editor, a list box for definition of sample test data, a list of global macros available for drag-and-drop and a preview window.
- Sample data - Specify template sample data. Each template parameter sample can be individually specified. The input can be either simple or JSON format input. Use JSON format for simulating complex structures. The sample data doesn't participate in the generation process. It is included only for testing your templates.
- Globals - Select and drag-and-drop a global macro to your template definition. You can implement your own global macros by including it in the VM_global_library.vm file. The file is located in the SSIS+ installation folder, under the VTL sub-folder.
- Remove Newline - Use this parameter to remove carriage return / line feed characters. Certain text documents like EDI do not expect to find new line characters in the output. However, new lines can be used to make template definition more readable. Having this parameter allows you to continue to use new lines for readability, without affecting template generation.
Parameters
General
Use the General page of the Template Task Editor dialog to configure the parameters needed to generate your text document.
Specify the task name.
Specify the task description.
Indicate whether or not the template layout is stored in a file. This parameter has the options listed in the following table.
Option Description True The template layout is stored in a file. Selecting this option displays the dynamic parameter TemplateFile. False The template layout is directly specified. Selecting this option displays the dynamic parameter Template. Specify the text template. For more information about template design, see Template Editor.
Select an existing File connection manager, or click <New connection...> to create a new connection manager.
Related topics: File Connection Manager Editor
Specify the template input encoding. For reference check the .NET Encoding.GetEncodings method.
Specify the result encoding. For reference check .NET Encoding.GetEncodings method.
Indicate whether or not the result file is stored in a variable. This parameter has the options listed in the following table.
Option Description True The result file is stored in a variable. Selecting this option displays the dynamic parameter ResultVariable. False The result file is specified in a File connection manager. Selecting this option displays the dynamic parameter Result. Select an existing File connection manager, or click <New connection...> to create a new connection manager.
Related topics: File Connection Manager Editor
Contains the result file path or output Stream object. Select an existing user-defined variable, or click <New variable...> to create a new variable.
Related Topics: Integration Services Variables, Add Variable
Dynamic
The list of parameters category is dynamically constructed based on your template design. For each template parameter, the task dialog will construct a pair of parameter source type and source type specific parameter selection.
Specify parameter source type. This parameter has the options listed in the following table.
Option Description DirectInput The parameter source is direct input. Selecting this option displays the dynamic parameter [parameter]Direct FileConnection The parameter source is file connection. Selecting this option displays the dynamic parameter [parameter]File. Variable The parameter source is a variable. Selecting this option displays the dynamic parameter [parameter]Variable. Destination The parameter source is a data flow destination. Selecting this option displays the dynamic parameter [parameter]Destination. Specify the parameter value.
Select an existing File connection manager, or click <New connection...> to create a new connection manager.
Related topics: File Connection Manager Editor
Select an existing user-defined variable, or click <New variable...> to create a new variable.
Related Topics: Integration Services Variables, Add Variable
Type the data flow destination (DataReader Destination), or click the browse button (...) and locate it.
Knowledge Base
- Where can I find the documentation for the Template Task?
- Create an HTML table from ADO.NET Dataset (requires 1.4 SR-1)
- Pass two objects to the Template Task
- How to access the #foreach loop counter
- Create an HTML table from ADO Recordset (requires 1.4 SR-1)
What's New
- New: Support for #evaluate directive.
- New: Support for activation of template helper classes.
- Fixed: Failed to generate result from data flow parameter in certain situations (Thank you, Federico).
- New: Support for loading of template layout from file connection manager.
- Fixed: Task now provides more diagnostic information during the generation process.
- New: Introduced task.
COZYROC SSIS+ Components Suite is free for testing in your development environment.
A licensed version can be deployed on-premises, on Azure-SSIS IR and on COZYROC Cloud.