mulcamd Posted December 16, 2011 Share Posted December 16, 2011 In my scriptlet I need to load a file.This file should be in the same folder / directory as the report file (JRXML or JASPER).Question: how can I determine the folder of the report I'm running?I tried the code below: But this give the folder of the iReport, in my case:Current dir : H:\Program Files\Jaspersoft\iReport-4.5.0 Yet I need the folder / directory the report file is in.Code:public void afterReportInit() throws JRScriptletException{System.out.println("call afterReportInit");try {System.out.println ("Current dir : " + dir1.getCanonicalPath());} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now