Jump to content

Subreport path in a Web App


Recommended Posts

By: jasperkan - jasperkannan

Subreport path in a Web App

2006-01-20 07:03

i 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:10

JR 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:48

I 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

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...