I pulled an old technique out of my bag for this one. I call this "group cloaking" and I think I will write it up for my next newsletter.
In this technique you can make an entire group level disappear by changing the group field to match the group above it, and then suppressing the GH and GF. Your report needs to have 4 groups, but you will only see 2 or 3 at one time, depending on the user's choice. Here is how it would work:
1) Take the original report and expand the parameter choices to be:
Customer Name -Alpha
Type - Alpha
State - Alpha
Region - Alpha
Customer MTD-Asc
Customer YTD-Asc
Customer MTD-Desc
Customer YTD-Desc
2) Add the formula that for your TopN subtotal to this report, but use the expanded parameter above to control what it returns. You can decide what field to subtotal on the Alpha options.
3) Group 1 (Salesman) doesn't change.
4) Add more cases to your Group2 formula so that when the user selects any of the TopN options (5-8), the formula returns Salesman. Also suppress the GH and GF when the report is a TopN. When the user selects a TopN option Groups 1 and 2 are the same, so Group2 has no effect on the report.
5) Add a new Group3 formula that returns Salesman on the TopN options (5-8) but returns Customer ID for the Alpha options. You can also suppress GH and GF for this group when the report is a TopN. For a TopN, the first 3 groups are the same.
6) Group 4 will always be Customer ID. The subtotals for this level will have the TopN applied to them. Of course, when Group3 is Customer ID in Alpha order, Group4's TopN will have no effect on the report. It will only have an effect if there is more than customer in each Group3. If the report is an Alpha report you can suppress GH and GF for this group. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com