Subreport isn't showing

Hello, I'm trying to pass a parameter from Java to Jaspersoft including a subreport that I've compiled into a JasperReport and some other values:

def subReport = classPathResourceLoader.getResourceAsStream("classpath:reports/subReport.jrxml");
parameters.put("subReport", JasperCompileManager.compileReport(subReport.get()));

I've also changed the main report's source code to use the parameters passed:

    <subreportParameter name="firstName">

As you can see I've also passed another parameter called firstName and I'm displaying it as well, however the subreport still isn't showing. What am I lacking? I hope you can help, thanks.

blamblam's picture
Joined: Apr 26 2021 - 6:37pm
Last seen: 2 years 2 weeks ago


mahadiosb - 6 months 1 week ago

Thank you, I can't believe I missed that.

blamblam - 2 years 3 weeks ago

1 Answer:

<!-- This is the size of your report -->

<reportElement x="0" y="0" width="200" height="100" uuid="8f4cd4e3-6e61-4116-baa9-7f819d8fc142"/>

<subreportParameter name="param">



<!-- By Default you have to put this  -->   


 <!-- Here is the path of your jasper file -->        


 <!-- you can pass also using parameter -->        



mahadiosb's picture
Joined: Jan 24 2020 - 6:53am
Last seen: 2 months 3 weeks ago