Jump to content
Changes to the Jaspersoft community edition download ×

Subreports Path - Using Conditional Paths


ldalberti

Recommended Posts

Hello all,

We are trying out a new system for managing our Jasper reports. We have a set of default subreports that on some occasions a specific client wants to override and use another format. What I'm trying to do it setup a "Reports" folder that contains the top-level reports with two subfolders within there called "Client" and "Standard". What I want to do is setup the Subreport Expression to first look at the Client subfolder for a specifically named file and if it doesn't exist, go to the "Standard" subfolder and pull the standard named file. This is my code in the Main Report (located in the Reports folder) to set up the condition so far but it always returns false:

new Boolean(new File($P{SUBREPORT_DIR}+"\Client\"+"InvCover_subInvoiceInfo_ABCD.jasper").exists())

The SUBREPORT_DIR parameter is set to "./", but I've used ".\" with no success. I have confirmed that the file does exist in that folder, so I don't know why it's coming back as false. I have tried setting up variables to add the subfolder name to SUBREPORT_DIR, but again no success. Any ideas? Thanks.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...