Web Development

General discussion


xml to excel conversion

By khanhqhoang ·

I wonder if someone could let us know how to convert an xml doc to an excel spread sheet. We don't want to use csv approach or using a third party vendor software. We also want to minimize client download as much as we can.
Our excel spread sheet need to have outline, formatting features like bold headings and borderlines.

Thanks a lot,


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

xml to excel

by CPMCBM In reply to xml to excel conversion
Collapse -

XML to Excel

by gibcire In reply to xml to excel

Excel handles html in its native format. It will render any style attributes that are embedded in the html output. Your xsl simply outputs the xml as you wish it to look in Excel but as html.

To handle the opening of the file we used the following statement in our jsp:

response.setHeader("Content-Disposition","inline; filename=bscreport.xls;");

Find more information on this on microsoft.com by searching for, "Microsoft Excel Web Connectivity Kit."

A word of caution on css: Excel doesn't interpret css statements. style attributes must be within the html tags. Excel also "interprets" the data and will automatically apply different formatting to cells that have "$" content vs. cells that have numbers.

Excel has a few other style classes that it will interpret. These are defined in the toolkit documentation.

Good luck,

Lorie Gibbons

Related Discussions

Related Forums