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

Suppress a Section if no records exists in sub report.

Status
Not open for further replies.

umeshs79

Programmer
Aug 7, 2002
42
DE
Hi,
I make Customer report which contains sub report of items related to the customer.
Layout is as follow:

Customer ID Name Address
-------------------------------------
00001 Jon XYZ

Item Qty.-> Comes from subreport.
------------------------
Item1 5
Item2 10

00002 Methew ABC

Item Qty.-> Comes from subreport.
------------------------
No item exist for this customer.

Now my problem is that if there is no item for a particular cusomter i want to supress the Item Header in sub report. As in 2nd record of customer only Item Header is printed

So please tell me how i suppres the Item header in sub report if there is no item for that particular customer.

I have tried in Supress option
if Count({Item.itemID}) = then
true
else
false

but this does not work, because there are items in item table but there is no item for given customer.
So please tell how it do it?

Thanks.
Umesh

 
It's not clear how you have the data set up, but if it's like this, then this solution may work...

MainTable
CustID
Name
OtherInfo...

ItemTable
CustID
ItemID
Count...

MainTable linked to ItemTable by CustID as a LEFT join

You can suppress the band by putting
ISNULL({ItemTable.CustID})
into the supression formula of that band.
 
Put the subreport in its own detail section, then format the section to "suppress blank section"
Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
I'm not sure if you just want to suppress the header and leave a blank space where that subreport object is in the container report or to suppress the whole subreport.

I just created a report that had 26 subreports (one for each letter of the alphabet). In order to suppress the blank subreports, I had to follow the suggestion which is in faq149-270 ....Not very pretty, but it did the job.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top