all groups > sql server dts > march 2004 >
You're in the

sql server dts

group:

Formatting an Excel sheet from a DTS package


Formatting an Excel sheet from a DTS package tjdalton311 NO[at]SPAM hotmail.com
3/11/2004 12:01:59 PM
sql server dts:
I have a fairly basic DTS Package that when all is said and done
exports a table to an Excel spread sheet. ( I do have some other stuff
in there with the file system object and stuff) Anyway here's my
problem.

The excel sheet gets exported no problem, and all the data is correct.
What I want to do is then take that excel sheet and do some basic
formatting on it. (bolding and centering the header row, autosizing
all the columns and freezing the header row) I saved all of this into
a macro, but can't seem to find a way to use this macro inside of the
package so when this report is run daily, the sheet is automatically
saved with the new formatting. Can anyone help me figure out a way to
get this sheet formatted the way I want it, without me having to
physically do it myself every morning.

Any help or suggestions would be great!

Thanks

Re: Formatting an Excel sheet from a DTS package rrazzano NO[at]SPAM netzero.net
3/11/2004 5:15:09 PM
One solution may be to use Excel's XML format. You could create a
package that dumps the table to a simple XML data file, then use an
ActiveX scripting task in the package to perform an XSLT transform to
make it into an Excel XML file.

Alternatively, you might be able to use FOR XML, EXPLICIT to go
directly to Excel XML schema from SQL Server, but that might be a
little tricky and/or ugly.

MS has their Excel XML format documented here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexcl2k2/html/odc_xlsmlinss.asp

hope that helps
Rick

[quoted text, click to view]
Re: Formatting an Excel sheet from a DTS package tjdalton311 NO[at]SPAM hotmail.com
3/12/2004 6:53:07 AM
Thanks for the help, I'll see if this will work for me



[quoted text, click to view]
AddThis Social Bookmark Button