marten.carlzon Posted February 28, 2020 Share Posted February 28, 2020 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/resourcesSince 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 weekendWrite you later / Mårten Link to comment Share on other sites More sharing options...
Solution I am Leo Posted March 2, 2020 Solution Share Posted March 2, 2020 I have a file named some-image.png I put in src/main/resources/static/imagesAnd 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 More sharing options...
marten.carlzon Posted March 3, 2020 Author Share Posted March 3, 2020 Ahh thanks 'I am Leo', that helped!Then I am one step closer to going up in jasper version, thank you! Link to comment Share on other sites More sharing options...
I am Leo Posted March 3, 2020 Share Posted March 3, 2020 You are welcome :D Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now