2005 IR Help Posted September 2, 2006 Share Posted September 2, 2006 By: amussa - amussa Subreport path can only be defined hardcode? 2005-07-15 11:20 Hi, I would like to know if the subreport path can only defined hardcode (eg: "C:/Reports/project.jasper") If all of the files were on the same directory, can't I include the .jasper file only by the file name eg: ("project.jasper") Is there some way of use subreport without have to harcode the path? Thanks By: Wal Millard - walmillard RE: Subreport path can only be defined hardco 2005-07-17 20:39 Yes! i pass all my main reports a parameter, $P{Path} which is of type String. i seed this parameter from my java calling code with : parameters.put("Path","c:\templates\Foo\FinSummary\"); NOTE : You should use the path seperator from the OS, instead of the "\" - this above is windoz ONLY! In my calling main reports i use $P{Path} + "MyFooSub.jasper" to call the report. NOTE: To compile and run in iReport (during design), set the "Default Value Expression" field in the parameter list to a path to your workings. i.e. like this... new String("c:\templates\design\Foo\FinSummary\") luck walmillard By: amussa - amussa RE: Subreport path can only be defined hardco 2005-07-25 16:52 Thanks for the help Walmillard, It worked! amussa By: buzzuk - buzzuk RE: Subreport path can only be defined hardcode? 2005-08-23 04:03 I tried your suggestion Walmillard but still can't get it to work. I'm running the reports from a java application. I'm using iReports 0.5.0. My reports are in the directory C:Documents and Settingsuser.nameMy DocumentsCreatorProjectsappnamesrcwebresourcesreports. I'm passing the full path C:Documents and Settingsuser.nameMy DocumentsCreatorProjectsappnamesrcwebresourcesreports to the reports at runtime in a parameter the way you said, but I'm getting an error. Error generating JasperPrint:Could not load object from location : Something is adding the following to the path of the sub-report srcwebresourcesreports so the file it's trying to load is this srcwebresourcesreportsC:Documents and Settingsuser.nameMy DocumentsCreatorProjectsappnamebuildresourcesreportssd_by_workflow_sub_jobs.jasper instead of C:Documents and Settingsuser.nameMy DocumentsCreatorProjectsappnamebuildresourcesreportssd_by_workflow_sub_jobs.jasper. It appears that iReports or Jasper is adding the extra directories. Anyone know how to stop it doing that? 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