show subreport when main report has no data
Posted on December 17, 2017 at 10:04pm
How can i show the subreport data when main report has no data?
Joined: Oct 5 2017 - 12:24am
Last seen: 5 years 4 months ago
Posted on December 18, 2017 at 6:13am
hi
in which band is the subreport?
Have you tried the whenNoDataType option at the root XML element (jasperReport)? Value could be "AllSectionsNoDetail".
from http://jasperreports.sourceforge.net/schema.reference.html#jasperReport :
whenNoDataType |
|
Allows users to customize the behavior of the reporting engine when there are now rows in the data source. |
|
Use: optional |
|
Base Type: string |
|
Values |
|
NoPages |
|
The generated document contains zero pages. |
BlankPage |
|
The generated document contains one blank page. |
AllSectionsNoDetail |
|
All the report sections except the detail section will get printed. |
NoDataSection |
|
The generated document contains only the noData section. |
|
greetz,
Marcus
Joined: Nov 7 2017 - 7:32am
Last seen: 1 year 4 months ago
Posted on December 18, 2017 at 2:29pm
Have you tried setting to "AllSectionsNoDetail" and set Print on Expression to not print a subreport when there is a data.
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 11 months ago
Posted on January 1, 2018 at 5:39am
thanks alot dear hozawa and dear Marcus
Joined: Oct 5 2017 - 12:24am
Last seen: 5 years 4 months ago