• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to produce multi-sheet excel output with XSLT

 
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

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

Thanks
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic