Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to display message on a main repor if a subreport has no data?

Status
Not open for further replies.
Apr 25, 2007
14
US
Hi all,

I have a report (main report) that has 6 subreports.
I would like to disyplay a text message such as "No Discount" on the main report in the subreport section.
Right now, the subreport section in the main report is suppressed if there is no data.
Does anyone know if there is a way to display message for NULL data subreport?
Thank you for your help in advance.

 
Create a section that says "No details found", in the subreport report footer.
Right-click on the section and choose Format Section. Then choose the formula icon (x+2 and a pencil) for suppression.
Test not isnull({your.field})
The section will appear when the subreport has no records and otherwise be suppressed.

PS. It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Thank you Madawc!
Honestly, I don't quite understand what you meant by "not isnull({your.field})". Did you mean I have to do for each data field that I used in the subreport?
for ex)
4 fields are used in the sub-report:
x.name, x.discount type, x.AMT, x.product
so the formula in the section expert(subreport footer) would be
-----------------------------
not isnull(x.discount) and
not isnull(x.name) and
not isnull(x.AMT) and
not isnull(x.product) and
-----------------------------
and create a text field (No details found) in the subreport footer?
Then the message will be displayed on the main report section where I have this subreport?

Sorry If I sounded so stupid. :)

Thank you again!!!
 
Madawc, please ignore my previous posting.
I just understood what you meant.
I'm not a morning person!! :)
I will go ahead and try your advise.
Thank you again!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top