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

Section Suppress based on BOTH subreports returning a zero

Status
Not open for further replies.

JCook23

Technical User
May 19, 2004
39
US
CR 10.0
SQL Server

I have a report that list all customers. I am linking two subreports to this main report; Orders and Sales. I want to suppress the section on the main report if Orders = 0 and Sales = zero. Something like this in the suppress field in the section expert:

If ({subreport.sales} <> 0 and {subreport.orders} <> 0) then false else true.

Is this possible?

Jeff
 
Possible - but ugly. You'd have to used shared variables and pass them from the subreports to the main report. To do this, you'll need to have the subreports run BEFORE the section you want to suppress in the main report. I've done this once before over a Macola database and ended up having two sets of subreport - the first two were minimized as much as possible and they merely established if open orders or invoiced orders existed. They returned the count of orders to the main report. The remaining subreports and section in the main report were suppressed based on the outcome of the initial two subreports - like I said, it was ugly. A much cleaner way is to use a union statement in a view or stored procedure to effectively flatten the open orders and invoiced orders tables into single rows.

Peter Shirley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top