Jump to content
We've recently updated our Privacy Statement, available here ×

SUBREPORT_DIR as relative path


marten.carlzon
Go to solution Solved by I am Leo,

Recommended Posts

Hi,

I am evaluating if we can go from iReport 5.1.0 to lastest Jaspersoft Studio and noticed problems first thing with SUBREPORT_DIR no longer being relative.

I imported a report and when I try to preview it I am unable to because SUBREPORT_DIR is unable to find the subreport, "Resource not found at subreports/SubreportHeader.jasper"

Our layout is for reports, subreports and resources as follows:
<some path>/reports
<some path>/reports/subreports
<some path>/reports/resources

Since we all have different path to the reports depending on the developer is it possible to have SUBREPORT_DIR (and assuming RESOURCES_DIR) as relative the way they where in iReport? Am I missing a configuration or am I using Jaspersoft Studio wrongly or is this just how it is setup now?

Have a nice weekend
Write you later / Mårten

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • Solution

I have a file named some-image.png I put in src/main/resources/static/images

And in my jasper template:
 

<image onErrorType="Blank">   <reportElement style="some-row" mode="Opaque" x="0" y="0" width="3116" height="843" forecolor="#FFFFFF" uuid="33d8b7cf-29f9-45ee-9397-4090f1e648a2">      <property name="com.jaspersoft.studio.element.name" value="someImg"/>      <property name="com.jaspersoft.studio.unit.width" value="px"/>      <property name="com.jaspersoft.studio.unit.height" value="px"/>   </reportElement>   <box>      <pen lineWidth="0.0" lineColor="#FFFFFF"/>   </box>   <imageExpression><![CDATA["static/images/some-image.png"]]></imageExpression></image>[/code]

You can point to your subreport use the above way.

Hope this can help you.

Link to comment
Share on other sites

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