OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Calling OpenOffice Calc from Java?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
CGuidice
Guest





PostPosted: Mon Mar 10, 2003 8:39 am    Post subject: Calling OpenOffice Calc from Java? Reply with quote

Can I call Calc from Java from my own Java program? I would like to use the charting capabilities built into Calc with reports generated with Java. Any information is very mush appreciated.

Thanks
Back to top
Guest






PostPosted: Tue Mar 11, 2003 2:25 am    Post subject: Reply with quote

This thread may help:

http://www.oooforum.org/forum/viewtopic.php?p=698
Back to top
guidice
Newbie
Newbie


Joined: 10 Mar 2003
Posts: 2

PostPosted: Tue Mar 11, 2003 5:55 am    Post subject: Link Reply with quote

Thanks for the link. This is helpful.
Back to top
View user's profile Send private message
guidice
Newbie
Newbie


Joined: 10 Mar 2003
Posts: 2

PostPosted: Tue Mar 11, 2003 9:12 am    Post subject: Additional links Reply with quote

In case others are trying to call OpenOffice applications from within Java, below is an example. Before running this Java code, I created a file in my C:\Temp\ called Test.xls.



import java.lang.*;
import java.io.*;

public class RuntimeExecTest {
public static void main(String[] args) {
Runtime rt = Runtime.getRuntime();
String[] callAndArgs = { "C:\\Program Files\\OpenOffice.org1.0.2 \\program\\ooocalc.exe", "C:\\temp\\Test.xls" };
try {
Process child = rt.exec(callAndArgs);
child.waitFor();
System.out.println("Process exit code is: " + child.exitValue());
}
catch(IOException e) {
System.err.println( "IOException starting process!");
}
catch(InterruptedException e) {
System.err.println("Interrupted waiting for process!");
}
}
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group