XSLTGeneral 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
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?
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
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).
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...).