2006 JR Open Discussion Posted August 22, 2006 Share Posted August 22, 2006 By: jasperkan - jasperkannan Subreport path in a Web App 2006-01-20 07:03i have a main report with a subreport and its working fine in the Ireports env .But when i deploy it to the WebApplication , the SUBREPORT_FILE_NAME has to specified as a relative URL ie /reports/subreport.jasper. this doesnt seem to work and its expecting the absolute path to be specified !!!!! . i tried all options like going one directory down ie subreport.jasper ./subreport.jasper ../reports/subreport.jasper /WEB-INF/resources/reports/subreport.jasper Is there any way to make jasper understand the relative URL ? Thanks n advance. By: Lucian Chirita - lucianc RE: Subreport path in a Web App 2006-01-24 01:10JR resolves reports (including subreports) locations as fs paths or class loader resources. If you specify a relative file path it will be interpreted relative to the current user directory. You can alternatively add the reports directory to the classpath and specify the subreport location as resource name. HTH, Lucian By: William Baker - wlbaker RE: Subreport path in a Web App 2006-02-09 07:48I use a different method. My reports use a parameter "BaseDir", which is "prompt=no" and populated by the report generating JSP. It has a default value that allows for good behavior in JasperAssistant. The subreport is then referenced as new File( $P{BaseDir}, "subreport.jasper" ); bbaker 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