Search code examples
crystal-reportssubreport

How to suppress on-demand subreport in crystal reports?


In my report there is an on demand subreport. The subreport is sometimes empty and in these cases i want it to be suppressed (i.e. the caption should not be visible)

Is this possible?

I tried using the checkbox under subreport -> "suppress empty subreport". it doesnt work however.

Thanks


Solution

  • "Suppress empty subreport" will have no effect on an on-demand subreport - these are only run on demand, and until they have been run it is impossible to tell whether or not they will be empty.

    If there is enough information in the main report to be able to tell whether the subreport will be empty - for example, if the subreport is a transaction breakdown and the main report includes the total transaction value, so that a total transaction value of 0 indicates that there will be no data in the subreport - then you can select Format Subreport in the main report section and conditionally suppress the subreport in the Common tab of the Format Editor dialog.