[#11136] - Unable to open subtemplates referenced via classpath

Category:
Bug report
Priority:
High
Status:
Feedback Requested
Project: Severity:
Major
Resolution:
No Change Required
Component: Reproducibility:
Always
Assigned to:
0

I'm creating a new reportin jaspersoft studio (also the same for the jaspersoft plugin in eclipse) and using

<subreportExpression><![CDATA[getClass().getResourceAsStream("my/report.jasper")]]></subreportExpression>

The jaspersoft studio is not able to resolve such an expression to open via double click the reference sub template. Working with absolute file names is not an option, as deploy them on a cloud environment.
My expectation was, the jaspersoft studio resolves such a reference?

brgds,
Max

AttachmentSize
Binary Data blank_a4_landscape.jrxml2.02 KB
v6.6.0
Jaspersoft Studio
max.mann's picture
Joined: Aug 24 2018 - 4:18am
Last seen: 7 months 29 min ago

1 Comment:

#1
  • Resolution:Open» No Change Required
  • Status:New» Feedback Requested
  • Assigned:nobody» teodord

Hi,

You don't need all that trouble to reference resources from classpath.
You simply need to put the String value in the expression and JRLib will look for it, including searching in the classpath.

<subreportExpression><![CDATA["my/report.jasper"]]></subreportExpression>

You only need to make sure the resource is indeed found in the classpath at runtime, in the package you expect it to be.

I hope this helps.
Teodor

Feedback