hibernate – The subreport is empty in the main report

Hello, I have a web application, a function generating a report per month, in the main report, I get a group by list of my applications. In the subreport, I have another list that takes a main report field as a parameter, to execute a SELECT. The problem is that the secondary report part is empty, I think finding the file is not a problem, because if I change the path, all that raises an exception, I really do not know the problem.

Main report code:

        <band height="102" splitType="Stretch">
                <reportElement mode="Opaque" x="7" y="10" width="540" height="80" backcolor="#006699" uuid="bca3d1da-6861-4cd4-aaf9-9a84890f4383"/>
                <box leftPadding="2">
                    <pen lineWidth="0.25" lineStyle="Dashed"/>
                    <reportElement x="10" y="26" width="260" height="43" forecolor="#FFFFFF" uuid="3a0b6d92-e8c7-4f71-97b2-35cffdabf0e8"/>
                        <font size="24" isBold="true"/>
                    <text><![CDATA[Faturas a Pagar]]></text>
                    <reportElement x="295" y="51" width="239" height="20" forecolor="#FFFFFF" uuid="66ed55dd-0b9d-4997-8dfa-e754806889c2"/>
                    <textElement textAlignment="Right">
                        <font size="14" isBold="false"/>
                    <text><![CDATA[FarAway | Fabrica de Software]]></text>


        <band height="79" splitType="Stretch">
            <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.HorizontalRowLayout"/>
                <reportElement x="0" y="0" width="555" height="79" uuid="c46b0670-94d2-4a25-971f-23cf25106b53"/>
                    <font size="16" isBold="true"/>

Class Bean, where I retrieve dates given by the user and execute the query for the main report:

public void generateReport () {

if (dataMenor.compareTo (dataMaior)> 0) {
JSFUtil.AddressErrorMessage ("Dates in an incorrect form! Enter the start date from the end date");

} else {
Listing list = invoicePayO.expExcelRel (dataMenor, dataMaior, null, 2);
if (list.isEmpty ()) {

} else {
InvoicesRel invoicesReports = new InvoicesRel ();
invoicesReports.geraReport (list, getDataMenor (), getDataMaior ());


Class where the main report is generated:

public void generateReport (List list, Date dataMenor, DateMayer) {
// Date dataMen = dataMenor;
// Date dataMa = dataMaior;
// DateFormat dateFormat = new SimpleDateFormat ("dd / MM / yyyy HH: mm: ss");
//// String dataMenorStr = dateFormat.format (dataMen);
//// String dataMaiorStr = dateFormat.format (dataMa);
InputStream stream = this.getClass (). GetResourceAsStream ("/ br / faraway / nicholas / reports / view / invoices.jasper");

Map params = new HashMap();

// params.put ("subReport", "br / faraway / nicholas / reports / view /");
ByteArrayOutputStream baos = new ByteArrayOutputStream ();

try {

JasperReport jasper = (JasperReport) JRLoader.loadObject (stream);

// to use JavaBeanDataSource, set & # 39; datasrc & # 39; as a data source
JasperPrint print = JasperFillManager.fillReport (jasper, parameters, new JRBeanCollectionDataSource (list));

// to use JavaBeanDataSource, set & # 39; datasrc & # 39; as a data source

JasperExportManager.exportReportToPdfStream (print, baos);

response.reset ();

response.setContentType ("application / pdf");

response.setContentLength (baos.size ());

response.setHeader ("Content-disposition", "inline; filename = Report generated invoices-FW");

response.getOutputStream (). write (baos.toByteArray ());

response.getOutputStream (). flush ();

response.getOutputStream (). close ();

context.responseComplete ();

} catch (Exception e) {
e.printStackTrace ();
JSFUtil.AddressError ("Error generating the invoice report.");


Do not forget that I use JPA / Hibernate to connect to the database.

My report comes like this:

insert the description of the image here

Miss the list of subreports.