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

Suppressing groups that contain no data 1

Status
Not open for further replies.

rji1124

Technical User
Nov 15, 2001
67
US
Hi... I am using CR9.0... I have a subreport that has a group (assignee.name)... the report shows all the tickets that are assigned for each person - works great - except I want to suppress those assignee.names that have no tickets...
Thanks for any help!
 
Within the subreport, check Database > Database Expert, or whatever the equivalent is in Crystal 9. You'll probably find that there is a left-outer link between Assignee and Tickets. Change it to an equal join and Assignees without tickets will no longer be shown.

It may also be you need them for counting, but not displayed. In that case, leave the link alone but do a group summary total for some field on the ticket. It should be zero for null, no data. Use Report > Selection Formulas > Group to select only those groups with a non-zero count.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Place the subreport in the section above the one you want to suppress, ie., in GH1a, while the groupname and other info is in GH1b. You can format GH1a to "underlay following sections" so that the info aligns correctly. Place a formula in the main report report header and in the group footer:

whileprintingrecords;
shared stringvar tickets := 0;

Then in the subreport, place a formula in the report footer:

whileprintingrecords;
shared stringvar tickets := distinctcount({table.tickets});

Then in the main report->section expert->GH1b->suppress->x+2 you can enter:

whileprintingrecords;
shared stringvar tickets;
tickets = 0 //note no colon

You should format the subreport to "suppress blank subreport" and also format the GH1a section to "suppress blank section".

-LB
 
Thanks for all the input... I am still having some problems with this - probably because of the way I setup the report intitially... I don't do a lot of worl with Crystal and so I am kept at a novice level whenever I get an assignment (1-2 times per year)...

My report uses only 1 table - I did try Madawc's idea about the group summary total, but couldn't get it to work properly.

I tried lbass' advice but I think because this report only consists of about 10 subreports, I was having issues on where to place the code (also the stringvar tickets:=o; statement required quotes - at least that is what I thought the error message was I was getting.

My group contents are assignee names (assignee.name) - under this group (in the Detail section) I pull in several fields like Ticket#, open time, etc.

Everything works fine except the report is pulling in assignee names that don't have any tickets for that subreport...

Don't know if I explained that well enough... if you have any other insights plz let me know...

Thanks so much
 
One additional thing I forgot to mention... in the subreports that have this happening in - when I did do a group summary total - there are indeed counts for those assignee names - which means they are getting selected as having records assigned to them - but not any based on the subreport selection criteria?
 
Sorry, my silly mistake. In all the formulas above, you should be referencing:

shared numbervar tickets;

-LB
 
thanks for still helping me, lbass - I tried this and now I don't get any tickets showing for the assignees... is it because I am doing this in the subreport only? The main report contains 10 subreports... I am trying to do this in one of the subreports, so I may be placing things in the wrong areas? Also, in GH1 - I have the 'column' headings that you helped me with in a separate post yesterday (recurring page headers)... The GH2 is the assignee.name group... sorry if I am noexplaining this very well..
 
OK - I think I know where I am going wrong here... this is happening on subreports where I have some suppression going on in the Detail section expert - I am calling formulas to suppress records that (for example) have not been updated for at least 14 days... I should probably do this somehow in the Group selection for the subreport I think..
 
That was it - a clumsy coding mistake on my part... thanks for all you help though! You got me thinking about this in a different light...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top