?
Solved

SSIS Export to Excel - Formatting Excel Output

Posted on 2010-01-12
6
Medium Priority
?
3,260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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

Technology Partners: 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!

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

764 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