SSIS+ Technical Support | How To | Knowledge Base
How To
Create an HTML table from ADO Recordset (requires 1.4 SR-1)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 #macro( main $rs ) <table> <tbody> <tr> #foreach($field in $rs.Fields) <th>$field.Name</th> #end </tr> #foreach($record in $rs) <tr> #foreach($field in $record) ...
Create an HTML table from ADO.NET Dataset (requires 1.4 SR-1)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 #macro( main $ds ) #set( $table = $ds.Tables.get_Item(0) ) <table> <tbody> <tr> #foreach($col in $table.Columns) <th>$col.ColumnName</th> #end </tr> #foreach($row in $table.Rows) ...
Pass two objects to the Template Task
1 2 3 4 5 #macro( main $list1 $list2 ) ... ... #end #main( $list1 $list2 )
Sample template text to create CSV from DataReader Destination
In the Template Editor dialog, check the 'Remove Newline' parameter. The Current object below implements the standard ADO.NET IDataReader interface. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 #macro( main $reader ) ...
How to format the Date
If the $dt parameter contains the DateTime structure and you want to format the date as "year-month-day", use the DateTime.ToString method like this: 1 $dt.ToString("yyyy-MM-dd")
How to access the #foreach loop counter
Use the $velocityCount variable reference to access the loop counter. The counter starts at 1.