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

Conditionally suppress group tree items 1

Status
Not open for further replies.

GMcNamara

Programmer
Jun 24, 2002
235
0
0
US
I have a Crystal Report written in XI. My report has three groups which are conditionally suppressed based on user selected parameter values.

I need the group tree to display. However, I only want the groups to display in the group tree when the group is not supressed in the report. Currently, if a group is suppressed, the item is showing as blank in the group tree. Is there a way around this?
 
I think the only way you can remove them is by removing them from the report in the record selection formula. Why not use the parameter to select the desired groups?

-LB
 
I am not sure I understand what you are proposing.

More report info: I have 4 params; Report Type, GroupSelection1, GroupSelection2, & GroupSelection3. So, if the user selects 'Summary by Sales Rep by Region by Product' for the Report Type param then Product becomes group 1 (and uses GroupSelection1 to allow product selection), Region becomes group 2 (and uses GroupSelection2 to allow region selection), and Sales rep becomes group 3 (and uses GroupSelection3 to allow Sales Rep selection). That works fine.

But, when I select 'Summary by Sales Rep' for the report type param, group 1 is Sales Rep and groups 2 & 3 are suppressed - but still show as empty groups in the group tree.
 
Unfortunately you're stuck with this as crystal will build a group tree containing all groups in the report

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
You should exlcude the records from the report entirely as Lbass suggested. If this is not an option, try conditionally setting groups 2 and 3 to the same database field as group 1 with formulas. Note: I have never tried this, it would be interesting to find out what happens.

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

"What version of URGENT!!! are you using?
 
It is not a matter of excluding records. If the user selects 'Summary by Sales Rep', I still need all of the records, I just want to show the single group for Sales Rep. But, if the user selects 'Summary by Sales Rep by Region by Product', I need the same exact data just with the added group.

So, the group tree for the 'Summary by Sales Rep by Region by Product' looks like:
GH1 Sales Rep
GH2 Region <hide this in group tree>
GH3 Product <hide this in group tree>

But I want the group tree for the 'Summary by Sales Rep' to look like:
GH1 Sales Rep
GH2 No group assigned <hide this in group tree>
GH3 No group assigned <hide this in group tree>


I could set the groups to be the same but I think my group tree would then look like:
+Sales Rep
+Sales Rep
+Sales Rep
 
You are right about your new field tree. I do not know of a way to do what you are asking.

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

"What version of URGENT!!! are you using?
 
Can you please lay out what the options are for each parameter, and also what you are grouping on (field or contents of formula)?

-LB
 

I have three groups, which are all formulas based on the user selection for the ReportType parameter. So for instance if the user selected 'Summary by Sales Rep by Region by Product' for the ReportType, Group1 would be Sales Rep, Group2 would be Region, Group3 would be Product. If the user selected 'Summary by Sales Rep' for the ReportType, Group1 would be Sales Rep, with Group2 and Group 3 suppressed (the formulas would evaluate to blank).

There are also several other parameter options for the ReportType; 'Summary by Appointment Setter', 'Summary by Product by Sales Source', etc.

I also have three parameters, GroupingSelection1, GroupingSelection2, & GroupingSelection3 which are used to include/exclude information in the report for the groups.

The groups contain some rather involved summary information, so I don't see a way to get around having the actual groups created. I just need to see if there is a way for the group tree to conditionally display groups.
 
Please show the content of the formulas you are grouping on. Please also show how the groupingselection parameters are being used. I think you could be using conditional grouping to eliminate groups from the tree, but I don't have enough info.

-LB
 
Group1 formula:
if {?ReportType} = 'Summary by Sales Rep by Region by Product' then
{Sales.SaleRep}
else if {?ReportType} = 'Summary by Appointment Setter' then
{Sales.ApptSetter}...

then I group on this formula.
Group2 formula:
if {?ReportType} = 'Summary by Sales Rep by Region by Product' then
{Sales.Region}
else 'Blank'

The GroupingSelection params are used in the selection criteria to exclude records. For instance, if the user chose 'Summary by Sales Rep' for the ReportType. the record selection would be Sales.SalesRep IN ({?GroupingSelection1}).


I just realized that I have not tried omitting the "else 'Blank'" portion of the grouping formula. I wonder if it would not create a group if no acceptable condition was found? I will test later.
 
Yes, omit the "else blank" so that the default is "". Then format the group 2 header to "suppress blank section".

-LB
 
lbass
Did you test this? Because I tried it with a couple of different reports and it isn't working for me. The group tree is still created with the blank item.

+ Sales Rep
+

Thanks for all your help but I am beginning to think this isn't possible.
 
see my earlier post

Gary Parker
MIS Data Analyst
Manchester, England
 
I don't get a + sign, just a dotted line like shaped like a capital L. I think that's the best you can do.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top