[#14201] - Resource not found at: <nested sub report name>

Category:
Bug report
Priority:
Normal
Status:
New
Project: Severity:
Minor
Resolution:
Open
Component: Reproducibility:
N/A
Assigned to:

Hi,
here's my problem.
I'm developping a complex report using JasperStudio 6.14.0 and resulting report have to be deployed in external server, out of my control.
I decomposed report in several subreports, some of wich have subreports inside.
In preview mode I got this error :

net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Resource not found at: proprietespartieequipement_1.jasper.

As you can guess, proprietespartieequipement_1.jasper is the nested subreport. Structure looks like this :
Main.jrxml
---> ProprietesPartieEquipement.jrxml
------>proprietespartieequipement_1.jrxml
------>proprietespartieequipement_2.jrxml

I tried a workaround :
I created a parameter SUBREPORT_DIRECTORY in Main.jrxml and I passed it to its subreport ProprietesPartieEquipement.jrxml

In ProprietesPartieEquipement.jrxml I prefixed its subreports expression with $P{SUBREPORT_DIRECTORY} :
$P{SUBREPORT_DIRECTORY} + "proprietespartieequipement_1.jasper"

In Main I manually filled parameter SUBREPORT_DIRECTORY with the local path of project files and all works well.

My problem is that this report is not portable to target external system, because it does not have the same path structure.
So I'd like to programatically fill this parameter in order to allow it to have the right value inside, whatever system running it.

Is this solution possible, or anoher one ?

Thank you

v6.14.0
info_1207's picture
Joined: May 13 2022 - 7:33am
Last seen: 3 days 2 hours ago
Feedback
randomness