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

Suppressing subreport

Status
Not open for further replies.

IanMac26

Programmer
Nov 16, 2007
20
NZ
Using CR XI.

I am producing a list of customers. I am using a subreport to exclude the customer if they have a particular type of transaction. Within the subreport I set a shared booleanvar true if the transaction is found.

The shared booleanvar is set to false in the hidden RH section and suppressed GF1c section.

The blank subreport is in GF1a (suppressed when blank)and the Customer name is displayed in GF1b (suppressed when blank)if the shared booleanvar is true.

My problem is that GF1a is never suppressed.If I suppress GF1a then my shared booleanvar is not set so I display all my customers, even if they have the qualifying transaction.

Sounds very compilcated for a "simple" report.

Cheers,
Ian
 
Why are you using a subreport for this? Is there not a way to link the customer table and transaction table?

If there is, dump your subreport and write it as one report. Hide the transaction details and place the customer info in the group header or footer. Then write a formula to test for the transaction type:

if {transType}="X" the 1 else 0

Sum this field by customer.

Then go to report, selection formula, group and enter:

Sum({MyFormula},{Customer})=0

This will exclude customers that have a transaction type of "X"

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
I am actually trying to report on customers that do not have a transaction of type x within the qualifiying date range.

So if the subreport finds the qualifying transaction then the customers are excluded from the main report.

Obviously the main report will always include customers who have no transactions.

Cheers,
Ian

 
Ian,

Please re-read my post. My example will exclude customers with a transaction type of X. Just replace the X with your transaction type.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
I understand what you are saying.

However I also need to include the customers who have no transactions in the report.

As soon as I link the transactions they are ommitted.
 
Ian,

dgillz solution should work if you link to the Transaction table with a left-outer join. That kind of link would not exclude customers that have no transactions.

Andy
 
Ian,

Just to clarify, on your report grab the customer info from the customer table, not the transactions table.

If you try this and if fails, please post back.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
The only way I could get the left outer join to return customers without transactions was to remove all transaction selection criteria from the original query. Then I could look at the transactions client side to decide if the customer should be excluded from the report.

Unfortunately this was quite slow because I got a row for every transaction (thousands of rows) rather than one row for each customer (hundreds).

Anyway my client is happy with the report with slivers of white space and I have gone over budget, so I am not putting in any more time on this report.

Thanks,
Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top