This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to produce multi-sheet excel output with XSLT

 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

What library can I use to produce multi-sheet excel output with XSLT ?

Thanks
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
xslt is for producing text, not binary output. You need to use a library like Apache POI.
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But isn't POI for producing Excel like :

Workbook w = new Workbook();
Cell c = new Cell();

ie creating excel files from Java?

Isn't there some way to specify that the output of my xsl can be excel format..in the same way that you can produce a pdf with xsl-fo?
 
Paul Clapham
Sheriff
Pie
Posts: 20958
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Duran Harris wrote:Isn't there some way to specify that the output of my xsl can be excel format..in the same way that you can produce a pdf with xsl-fo?

No.
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay but I found this post on StackOverflow that seems to be doing what I want? http://stackoverflow.com/questions/2160159/create-excel-speadsheetml-output-with-xslt
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it does what you need done - great! But it sure doesn't create an Excel file. (And SpreadsheetML is obsolete to begin with.)

Have you considered creating a CSV file? All versions of Excel can import those.
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You say that it doesn't create an excel file...I was under the impression that the spreadsheetML would be able to be opened as an excel spreadsheet?

A csv would be great except for the fact that I need multiple sheets...I dont need formulas or anything else like that,
I just need my data on multiple sheets.. would spreadsheetML output not do this properly?
 
Paul Clapham
Sheriff
Pie
Posts: 20958
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Duran Harris wrote:I was under the impression that the spreadsheetML would be able to be opened as an excel spreadsheet?


Seems to me that it shouldn't be hard to set up a test which would answer that question...
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I ran the xml and xsl through the org.apache.xalan.xslt.Process class and was rewarded with some spreadsheetML...
But if I try open it with Open Office as a spreadsheet it opens Open Office Writer with the text content instead although
I did save the output of the transformation as .xls ...
Maybe I should spend a couple weeks figuring out this xsl stuff before I waste more time on this.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there ever was an application besides MS Office that could make sense of the Office 2003 XML formats. This has nothing to do with XSLT.
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay I think I'll give up on this one for the time being..
Although Open Office Calc 2.0 does have the option of "Excel 2003 XML *.xml" in it's file open dialog...This gave me the wrong idea
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic