Exporting to Excel using SSIS -
11-01-2006
, 04:41 AM
Hi, I'm interested in best practices for exporting data to files whose names
aren't known at design time. What's the best way to export a file to Excel
and still have control over the column mappings?
Previously for flat file exports I have used a property expression on the
ConnectionString property which works but you end up mapping all variables to
one overall field (as there is no place to define the structure of the
destination file). This technique (using the ExcelFilePath property) doesn't
work for Excel and even if it did you would need to have control over the
fields/columns?
My current solution is to maintain an Excel template which has a single row
with column headings, then use a FileSystemTask to copy this template to the
new file name, which then can be mapped. This seems to work but I'm not sure
it's the best way to do it. Also I can't seem to maintain any control over
the column formatting: all my numerical values come through as text even
though I have converted the data types. There must be some way to avoid
having to open up all the Excel files and change their formatting??
TIA,
Rob |