Monday, March 26, 2012

Emailing an Excel file

Hi ,

Is it possible for us to send an excel file generated in the package to the users using Sendmail task or anyother task using SSIS?

Any help is greatly appreciated.

Thanks,

SVGP.

Yes. You will need to set the Attachment property for the task. Now, I am not sure if you are creating a new instance of the Excel file for each package run; if you are then you will need to create a variable or two to provide the full path of the file and then set the Attachment Property using an expression that references the variable.

For instance, I use a Flat File destination and open it getting created by the package I use a File System Task to copy the file to another location, renaming with an extension of the current date. For each run therefore the file name is going to be different and so I created a variable that dynamically captures the new file name each day. The Send Mail task then attaches the correct file each day.

Hope this helps!

|||

Hi swan_sgp,

Yes. This is Possible.

1) Use a global variable (gvExcelFile) to fetch your so created fully qualified excel file path with extension name.

2) You must manually configure an attachment (creates a new connection manager), as Desibull already informed.

3) Assign gvExcelFile to Connection String property in expression builder for the connection manager meant for attachment.

4) Set the DelayValidation Property of the Send Mail to True.

Thanks

Subhash Subramanyam

|||

Hi Subash,

I need to create a new excel file daily and then need to mail it.

The problem iam facing is that ,when i schedule a job the task that dumps data into excel(Dataflow task ) gives a validation error.Everytime i need to manually link the sheets of the excel to the corresponding tables.

Any idea why this is happening?So iam unable to schedule as a job...

Thanks,

Vani

|||

You might take a look at this for some ideas:

http://rafael-salas.blogspot.com/2006/12/import-header-line-tables-into-dynamic_22.html

No comments:

Post a Comment