| View previous topic :: View next topic |
| Author |
Message |
CGuidice Guest
|
Posted: Mon Mar 10, 2003 8:39 am Post subject: Calling OpenOffice Calc from Java? |
|
|
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
|
|
| Back to top |
|
 |
guidice Newbie

Joined: 10 Mar 2003 Posts: 2
|
Posted: Tue Mar 11, 2003 5:55 am Post subject: Link |
|
|
| Thanks for the link. This is helpful. |
|
| Back to top |
|
 |
guidice Newbie

Joined: 10 Mar 2003 Posts: 2
|
Posted: Tue Mar 11, 2003 9:12 am Post subject: Additional links |
|
|
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 |
|
 |
|