Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2003, 12:05 PM
uit uit is offline
Authorized User
 
Join Date: Jul 2003
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT to create formatted Excel sheets?

Greetings -

I know very little of XLST and I am wondering if someone who does would be able to tell if its possible to create formatted Excel spreadsheets from data coming out of a SQL Server 2000 query?

Right now I save the data as a CSV file, change the content-type and let the user download/open that file in Excel. Its not formatted at all however.

This is where I am thinking XSLT might be able to help? Or am I way off base? Has anyone got a different suggestion or board I should post this question on - if not XSLT?

Any help would be appreciated greatly!

Cheers!
 
Old August 8th, 2003, 03:10 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Provided they are using Excel 2000 or above, even Excel 97 will work at a more limited level, then the easiest way is to create an HTML table formatted as you wish. If the content type is set to "application/vnd.ms-excel" the formatting will be carried through.
See this link:
http://support.microsoft.com/default...b;EN-US;199841

You could also try this:
http://support.microsoft.com/default...B;EN-US;271572



--

Joe
 
Old August 8th, 2003, 08:21 AM
uit uit is offline
Authorized User
 
Join Date: Jul 2003
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Joe!

The first link is basically how I perform the operation now. The second link is very interesting and I will look into that further.

Thanks for the reply!!

Anthony
 
Old September 2nd, 2003, 12:53 PM
Registered User
 
Join Date: Jun 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've done the XML-SS and it's pretty easy. The best way to learn in to open up Excel 2002/XP, create a sample worksheet (you can use formatting, and formulas), save as 'XML'. Then edit the result and you'll see what gets generated (XML-SS).
 
Old October 7th, 2003, 08:18 PM
Authorized User
 
Join Date: Oct 2003
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have had to do this a couple times now. The best way I found was to create the desired file in Excel (2000 or later is best) and apply all the formatting that you want in the output, then "save as" html. I then edit the resulting html file and turn it into a stylesheet (there are also utilities out there to convert html files into stylesheest...).

good luck,

...sam





Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing two excel sheets nbkn8ct Excel VBA 5 August 28th, 2009 05:20 PM
Working with excel sheets ramsri VB How-To 1 October 25th, 2007 03:15 PM
Import From excel with n sheets dbellavi SQL Server DTS 1 September 11th, 2007 07:51 AM
Export Access table to a pre-formatted Excel file mccoy Access VBA 2 May 25th, 2007 08:04 AM
open a formatted excel file from program darvarin C++ Programming 1 June 15th, 2005 03:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.