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

Using a Main report with a Not Equal Join 1

Status
Not open for further replies.

chaverly

Technical User
Sep 24, 2004
18
0
0
US
I am using Version 8.5 Crystal Reports with an Access Database. Due to database design I am using a Not Equal Join on 2 tables. The Contact History table UserId to the AllUser table UserID.
ContactHistory.UserId -> ALLUser>UserId.
The -> link is the Not Equal Join.
The ALLUser table is larger.

I am grouping by ALLUser.UserID in the Main report and calling 2 subreports that calculate the amount of calls, emails, appointments that the Contact History table has in it.

Of course, I am getting many records with no data in either subreport (all zeroes for the amount of calls, emails, appointments). I want to suppress the subroutines when this happens.

I created 2 shared variables, 1 per subreport to tell me when either subreport returns zero records.
#RT_Vs_Down are running total counts.


WhilePrintingRecords;
shared NumberVar flag1;
if {#RT_Vs_Down} <> 0 then
flag1 := 1
else
flag1 := 0

WhilePrintingRecords;
shared NumberVar flag2;
if {#RT_Vs_Down} <> 0 then
flag2 := 1
else
flag2 := 0

Then I created 2 formulas in the Insert section Below of the footer to get GetFlag1 and GetFlag2

WhilePrintingRecords;
shared NumberVar flag1;
WhilePrintingRecords;
shared NumberVar flag2;

How can I use this to suppress both subreports when both are empty?



 
Subreports cannot suppress themselves after they've run.

You can prefire them to determine if they're blank in advance, shrink them to tiny little dots, and then suppress the section that they're in based on some shared variables.

Consider redesigning the data source in Access as a Query which returns only the data required and eliminating the subreports.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top