Search code examples
jasper-reportssubreport

Why is subreport inside main report showing a line when sub report is blank?


I have created table view inside main report.

Inside table row I am taking sub-report, when sub-report having data it works perfectly but when sub-report is empty it showing one black color line inside table row.

I had set the properties for sub-report 'remove line when blank= true' it is working in only sub report, but when I am compiling main report it showing one line.

This is my output Current result


Solution

  • To remove the subreport, you need to

    1. isRemoveLineWhenBlank="true" in mainreport on the subreport's, reportElement tag

    2. whenNoDataType="NoPages" in subreport on the jasperReports tag (or remove attribute, default is NoPages