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 dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

suppressing a subreport when there is no data

Status
Not open for further replies.

tazibc

Instructor
Oct 5, 2007
66
GB
Please can someone help I am trying to suppress a subreport when there is no data. and I want to show the word "no data" I keep getting the page heading appearing and the subreport does not suppress pls advise
 
Please specify your CR version. It would also help to know in what report section the subreport is located.

Why not place a formula that returns 'No data' in the subreport instead of in the main report?

-LB

 
I am using veriosn cr 2008 the sections are the following:-

subreport in the following sections
report hearder g
report hearder h
report hearder i
report hearder j
report hearder k
report hearder L
report hearder m

If there is no data in the subreports I want the word "no data" to appear. I also want to suppress a graph report header h if brings back no data can you help pls i am in desperation.
 
If you want to display the message within each subreport, then you need to UNcheck "suppress blank subreport" on the format subreport->subreport tab, and also go into file->report options and make sure that "suppress printing if blank" is NOT checked. Then create a formula in each subreport like this:

if isnull({table.ID}) then
"No Data"

Place this in the report header.

This assumes that the subreports are null, and that they are NOT blank because of suppression or group selection.

You should be able to use a formula like the following to suppress a chart object:

isnull({table.showvaluefield})

-LB
 
Thanks for this but even though I try this it still brings up the report page headers and there is a gap in my report preview which shows page headers with the word no data.

Can I not just have the word "no data " appear with the whole report reduced in size and not the same size as the original report.
 
Right-click on each section and set a conditional suppress. If there's no data, then a field value should be null.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Do You mean on each and every section of the subreports??

would I use the ISnull function ??
 
I have a similar question. so i have a subreport that lists all Historical Activities. i put this subreport in a pending activities report. they are both grouped and linked by contact. but the pending activities report only has about 8 contacts while the historical report has around 40. so when i put the subreport in, it puts blank spaces after each pending contact thats not on the historical report if that makes sense. so how to i make it so if the contact on the pending report isnt on the historical, dont put the subreport after that contact or something like that.
i looked at your formula above lbass and it looked like the isnull formula you posted is for a specific field. but i would want the whole subreport to be suppressed except the times it had contacts in it.

If thats WAY too confusing let me know...

Valgore
 
You need to set suppress for anything that's currently showing and is unwanted. The Isnull function is the way to do it. It can be applied both to fields and sections.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top