Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dataset to XML/XSLT for Excel Export

Status
Not open for further replies.

sunmorgus

Programmer
Nov 9, 2004
81
US
Ok, so here is the deal. I have a dataset that I want to export to excel using XML/XSLT. I have a fairly general idea about how all of this should work, and have found many resources on the 'net, but none seem to really get me going on how this whole thing should work.

So here is what I have...I have a stored procedure on my sql server that builds a dataset in my asp.net application. This dataset has dynamic headings (it is a crosstab query, so the headings from report to report can be different). I can understand the process for getting the dataset to xml, but I am giving myself a headache trying to figure out the xsl transform part.

How do I build a "dynamic" stylesheet, so that my xml spreadsheet can be exported into excel? Or am I thinking about this totally wrong? Is there a way to do this? Any help would be greatly appreciated!
 
What do you want the output from the XSLT to look like, so you can import it to Excel?

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Basically, it just needs to dump the data into the spreadsheet. I don't need any formatting or anything like that, no special styles, or anything at all...
 
So you could ditch the whole XML/XSLT thing and just iterate over the data separating it with commas, no? If you wanted to get clever, you could quote any character fields with embedded commas and escape any embedded quotes for a foolproof solution...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top