Project

General

Profile

Defect #751

Specifying SUBREPORT_DIR as a relative path doesn't work.

Added by Corey Puffalt over 10 years ago. Updated about 10 years ago.

Status:
Resolved
Priority:
High
Start date:
11/01/2013
Due date:
% Done:

0%

Estimated time:
Browser (if web client):

Description

It looks like the intent is to be able to set the SUBREPORT_DIR as a relative path but this doesn't actually work. From looking at the code in JasperReportRunner it looks like there's a bug in that the code is not pre-pending the jasperDirectory on the front. Ironically, specifying SUBREPORT_DIR as an absolute path is a workaround even though the code logs a warning saying this cannot be done!

I've attached a patch with proposed fix that cleans the code up a bit, it also changes the code slightly to throw a JRException if SUBREPORT_DIR is not a relative path and also cleans up the exception handling block to chain the cause when throwing a JRException.


Files

jr.patch (2 KB) jr.patch Corey Puffalt, 11/01/2013 11:18 PM

History

#1

Updated by Corey Puffalt over 10 years ago

Another note on the patch. I removed the null check on jasperDirectory because there's already code a few lines above that would blow up with a NullPointerException if jasperDirectory is null. I also removed the length check as I just didn't see the value in that either. I don't see how a report can be successfully run without the jasperDirectory being specified anyhow... Furthermore, the check for trailing / was unnecessary because code further above already checks and appends it if necessary.

#2

Updated by Andrei Costache about 10 years ago

  • Status changed from New to Resolved
  • Assignee set to Andrei Costache

Patch looks good, added to 4.x version of plugin, with a small difference for the chained exception.

As a sidenote: improved error reporting has been added by Rob for same case in January. Not using the chained exception.

Also available in: Atom PDF