?
Solved

SSIS Export to Excel - Formatting Excel Output

Posted on 2010-01-12
6
Medium Priority
?
3,524 Views
Last Modified: 2012-05-08
Hi guys,

Just wondeirng if this would be possible within SSIS..

I am using SSIS to extract data from 3 different views created in sql and populate 3 different  excel sheets within the same spreadsheet with the respective results.

I am using the File System task to delete the spreadsheet and the Execute Sql Task to recreate each of the sheets within the spreadheet before populating them with the respective data.

The package runs successfully and emails the excel output.No issues. Is there anyway that one could apply conditional formatting/formatting (highlighting,bold,etc) to the information in the sheets/spreadsheet from within SSIS before the report is emailed out?

If so, please can you provide some information on how this can be done.

Thanks

Regards,

Vinay
0
Comment
Question by:CrispyC4
  • 3
  • 3
6 Comments
 
LVL 30

Accepted Solution

by:
Reza Rad earned 375 total points
ID: 26291766
you have to ways to do this:
1- create an excel file with all formatting (bold,highlights,...) and use it as a template for filling the data
2- use a script task to apply formatting in excel file

first way is simple and easy to do
second way is hard and you must open the excel file in code and change programatically
0
 

Author Comment

by:CrispyC4
ID: 26291965
Just some more information on what else I tried....

I created a blank template with headings only  that contains the conditional formating, then used a File System Task to copy this to another file which I am populating.

Since I'm testing this using the copy file function, I disabled the Execute SQL tasks that I previously had that creates the respective sheets. The conditional formatting now comes through with the data... but.. it now appends the results to spreadheet.
0
 
LVL 30

Expert Comment

by:Reza Rad
ID: 26292120
could you upload your package and the excel file?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:CrispyC4
ID: 26300890
Hi Reza Rad,

I managed to get this working.. what I was missing in the File System Task that copies the formatted excel file was the option to overwrite the destination file. Once I set this to "True", results are no longer appended and the formatting comes through correcly.

Thanks for your assistance.

Vinay
0
 

Author Closing Comment

by:CrispyC4
ID: 31676012
Had to use a template with the formatting and copy this to  another file that I am populating with the data from the SSIS package
0
 
LVL 30

Expert Comment

by:Reza Rad
ID: 26301775
Glad to help,
Regards,

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Suggested Courses

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question