show subreport when main report has no data

How can i show the subreport data when main report has no data?

b.fallahi's picture
Joined: Oct 5 2017 - 12:24am
Last seen: 5 years 4 months ago

3 Answers:

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

Marcus W's picture
355
Joined: Nov 7 2017 - 7:32am
Last seen: 1 year 4 months ago

Have you tried setting to "AllSectionsNoDetail" and set Print on Expression to not print a subreport when there is a data.

 

hozawa's picture
176589
Joined: Apr 24 2010 - 4:31pm
Last seen: 3 years 11 months ago

thanks alot dear hozawa and dear Marcus

b.fallahi's picture
Joined: Oct 5 2017 - 12:24am
Last seen: 5 years 4 months ago
Feedback
randomness