About iReport

It it possible to run iReport from java application?

I whant to open in my java program report generator like iReport..

In my program I'm useing with JasperReports and show the report with JasperViewer.

I whant to be able to edit a new report from my java program, I mean: if I clicked on the JButton, for example - I whant that the iReport will open to me.

Thanks,

Yael.

[409 byte] By [yael800a] at [2007-11-26 18:09:25]
# 1

do you want to run an external program?

if so you would run it like this:

String str = "C:\\directory\\program.exe";

Process proc = Runtime.getRuntime().exec(str);

result = proc.waitFor();

if (result != 0) {

System.err.println("Program did not finish properly";

}

sjs1985a at 2007-7-9 5:41:22 > top of Java-index,Desktop,Core GUI APIs...
# 2

Yes' This is what I whant, but I'm geting error dialog:

Java virtual machine launcher

Could not fined the main class, program will exit.

The code:

String str = "C:\\MyJava\\iReport-1.3.0\\iReport.exe";

Process proc;

try {

proc = Runtime.getRuntime().exec(str);

try {

if (proc.waitFor() != 0)

System.err.println("Program did not finish properly");

} catch (InterruptedException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

}

} catch (IOException e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

}

yael800a at 2007-7-9 5:41:22 > top of Java-index,Desktop,Core GUI APIs...
# 3

if you want it to be a stand alone prog it must be like this

public class runApp {

Process proc;

runApp() {

String str = "C:\\MyJava\\iReport-1.3.0\\iReport.exe";

try {

proc = Runtime.getRuntime().exec(str);

if (proc.waitFor() != 0) {

System.err.println("Program did not finish properly");

}

} catch (Exception e1) {

// TODO Auto-generated catch block

e1.printStackTrace();

}

}

public static void main(String[] argz) {

runApp run = new runApp();

}

}

sjs1985a at 2007-7-9 5:41:22 > top of Java-index,Desktop,Core GUI APIs...
# 4

You know..I'm thinking that I'm missing some file to complite iReport running. (with this code I get the same error).

maybe I need to set more files to run this app?

If I coppy to some place in the computer only the iReport.exe file - then click on it to run this program, I get the same erro :)

yael800a at 2007-7-9 5:41:22 > top of Java-index,Desktop,Core GUI APIs...