?
Solved

How to generate/export OpenOffice Calc(Spreadsheet) using Java?

Posted on 2005-04-17
16
Medium Priority
?
1,384 Views
Last Modified: 2008-02-01
Hi,

Anybody know how to generate/export OpenOffice Calc(Spreadsheet) using Java?
I know how to generate Windows Excel document by using JExcel API, but how do I do it for OpenOffice or StarOffice?

Please advise, Thanks.
0
Comment
Question by:rospcc
  • 9
  • 7
16 Comments
 
LVL 92

Expert Comment

by:objects
ID: 13803448
0
 
LVL 92

Expert Comment

by:objects
ID: 13803461
0
 

Author Comment

by:rospcc
ID: 13803546
Thanks for the reply objects, Is it possible to generate chart if using your XML method?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 92

Expert Comment

by:objects
ID: 13803563
0
 

Author Comment

by:rospcc
ID: 13814014
I don't understand the sample which was written in Phyton.
Do you know whether is there any samples which is written using Java?
How do I write java to xml?
0
 
LVL 92

Expert Comment

by:objects
ID: 13819819
Heres how to write an XML file:

http://www.javaalmanac.com/egs/javax.xml.transform/WriteDom.html

And lots of other examples for dealing with XML:

http://www.javaalmanac.com/cgi-bin/search/find.pl?words=xml
0
 
LVL 92

Expert Comment

by:objects
ID: 13819823
0
 

Author Comment

by:rospcc
ID: 13822305
By using the XML method to create CALC document, do I need to use java to write all these files: content.xml, styles.xml, meta.xml, settings.xml, META-INF/manifest.xml ?
How do I convert all the Java created xml mentioned above into OpenOffice Spreadsheet document programatically?

I found out that there's 2 ways to create OpenOffice documents using java:
1. XML (As what you suggested)
2. OpenOffice SDK

Do you think is it easier to generate using OpenOffice SDK?
0
 
LVL 92

Expert Comment

by:objects
ID: 13822418
> Do you think is it easier to generate using OpenOffice SDK?

Haven't used it but I would it would be easier.
0
 

Author Comment

by:rospcc
ID: 13822440
For XML method:
Firstly, do I need to use java to write all these files: content.xml, styles.xml, meta.xml, settings.xml, META-INF/manifest.xml ?
How do I convert all the Java created xml mentioned above into OpenOffice Spreadsheet document programatically?
0
 
LVL 92

Expert Comment

by:objects
ID: 13822503
Open Office documents *are* XML files.
0
 

Author Comment

by:rospcc
ID: 13822570
I see..which means after I've created the xml using java, I need to zip them back into one file (.sxc) ?
Is there a way to use Java to zip those xml files into one file (.sxc) programmatically?
0
 
LVL 92

Expert Comment

by:objects
ID: 13822673
I'd look at what the OO api supportsd first, most likely will save you some work

http://api.openoffice.org/docs/DevelopersGuide/Spreadsheet/Spreadsheet.htm
0
 

Author Comment

by:rospcc
ID: 13840107
I can't seem to install and use the SDK successfully.
Are you able to use it?

I got the following problems:
1. The link is broken for downloading makefile, Does it cause the API not to work?
2. Can't compile sample codes (Most crucial one), it says:
      package com.sun.star.document does not exist
3. There this command that I need to invoke, but how do I know which port should I use?
    soffice "-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager"
      
0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 13863491
> 2. Can't compile sample codes (Most crucial one), it says:
>     package com.sun.star.document does not exist

Have you made the classes available to youyr classpath

0
 

Author Comment

by:rospcc
ID: 13863667
It's working now..some of the classpath missed out.
Thanks objects.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month16 days, 3 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question