2004 IR Help Posted August 24, 2006 Share Posted August 24, 2006 By: Cadiolis - cadiolis2 subrpt "Could not load object from location" 2005-11-30 10:16 I have a report that I made with ireport. It consists of a main report and two sub-reports. All the report files live inside the same directory and the report runs just great from within ireport. Now I wrote a little java app to run the report. The code looks like: JasperReport report = (JasperReport)JRLoader.loadObject(cwd + sep + "reports" + sep + "WorkoutReport" + sep + "WorkoutReport.jasper"); JasperPrint print = JasperFillManager.fillReport(report, params, conn); So I am passing in the full path to the WorkoutReport.jasper file (cwd variable is the current working directory). I have also tried passing in the relative path. As you can see the report lives in "reportsWorkokutReportWorkoutReport.jasper" and as I mentioned, the subreports are right beside this jasper file. The above code results in the error "Could not load object from location : Email_Subreport.jasper" Can anybody tell me why it cannot find the jasper file for the sub-report when it is RIGHT beside the main report jasper file? Or perhaps how it should look for loading sub-reports? In the main report I am simply specifying the subreport as a string that looks like "Email_Subreport.jasper" Please help!!! By: Ali Kianzadeh - alikian RE: subrpt "Could not load object from location" 2005-11-30 12:59 Hi, Have a parameter for example basePath and set it with folder path which contains reports. Then use it like this $P{basePath}+"/Email_Subreport.jasper" 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