call an external program

I am trying to get my XOJO program to run jasperstarter (a command line java script that will run a jasper report)… how do I call jasperstarter from inside the xojo program?


create a folderitem with the path to the external app

then issue the command f.launch

OR… use the SHELL

depends on what the program does… if your app has to wait, or it returns a result string… use SHELL

Agree with Dave, you most likely need to use the Shell class to send terminal commands.

Ok, I tried as both shell and folderitem:

Dim jReport As Shell
jReport.Execute("/files/Downloads_archive/jasperstarter/bin/jasperstarter pr /files/buylist_rb/valuation.jasper -t mysql -u gary -f view -H -n XXXXX -p XXXXX --jdbc-dir /usr/share/java")
Dim jReport As FolderItem
jReport.GetFodlderItem("/files/Downloads_archive/jasperstarter/bin/jasperstarter pr /files/buylist_rb/valuation.jasper -t mysql -u gary -f view -H -n XXXXX -p XXXXX --jdbc-dir /usr/share/java")

(the XXXX;s represent the database name and password, they are filled in with the correct paramaters in my program)

I keep getting a nilobject error for both versions?? I thought it needed the full path names, but that did not correct the error??

Dim jReport as new Shell

Should do it - I can’t comment on the command itself.

You can also use folder items, look for the .shellPath function.

I guess I am getting closer… I modified the dim statement to Dim jReport As new Shell, along with the jReport.Execute line above…

The error goes away, but NOTHING happens… no report appears

After the execute command, check the shell.result property as it may hold an answer there.

Thanks Sam… There was an error message… when I tried the command in a shell window, I did get the error, (two lines about font file being deprecated) but the program eventually ignored it and displayed the report, but XOJO does not ignore it and the shell execution stops with the error.