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

Skip grouping option straight to detail section

Status
Not open for further replies.

avaya20

MIS
Jul 8, 2009
2
US
I have a report that has 4 possible grouping sections: Vendor, Major, Minor & SKU. I have four parameters and four formulas so they may select these. I want to have a 'No Group' option that will stop the grouping and skip straight to the detail section.

For example, if the report is grouped by Vendor, Major and then on the 3rd group 'No Group' is selected, I want the users to be able to just look at the detail section related to that Vendor and Major. My issue now is that the users either have to select 4 groups or click through blank sections that may be too detailed for what they want to see.

Any suggestions? I'm using CR 2008. Thanks in advance.
 
You can't really get rid of a group at runtime (unless you are writing some VB or .NET code) but you can make it look almost the same by "masking" the unwanted groups.

When you don't want group 3 at all set the value for group 3
to be the same as group 2, and suppress the header and the footer for group 3. Do the same for group 4 assuming you don't want it either. The last 2 groups will now have no affect on the order of the records and will be invisible.

The only problem will be redundant entries in the group tree.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guides to Formulas, Parameters, Subreports, Cross-tabs, VB, Tips and Tricks
 
This is similar to Ken's suggestion, and assumes that the groupings would always occur in the same order. You could create another parameter {?GrpBy} with the various options that you want to allow, i.e., "Vendor, Major, Minor, SKU", "Vendor, Major, Minor", "Vendor, Major", "Vendor", "Do Not Group". Then create a selection formula like this:

(
{?GrpBy} = "Vendor, Major, Minor, SKU" and
{table.vendor} = {?Vendor} and
{table.major} = {?Major} and
{table.minor} = {?Minor} and
{table.SKU} = {?SKU}
) or
(
{?GrpBy} = "Vendor, Major, Minor" and
{table.vendor} = {?Vendor} and
{table.major} = {?Major} and
{table.minor} = {?Minor}
) or
(
{?GrpBy} = "Vendor, Major" and
{table.vendor} = {?Vendor} and
{table.major} = {?Major}
) or
(
{?GrpBy} = "Vendor" and
{table.vendor} = {?Vendor}
) or
{?GrpBy} = "Do Not Group"

Then create a separate formula for each group:

//{@VendorGrp}:
if "Vendor" in {?GrpBy} then
{table.vendor}

//{@MajorGrp}:
if "Major" in {?GrpBy} then
{table.major}

//{@MinorGrp}:
if "Minor" in {?GrpBy} then
{table.minor}

//{@SKU}:
if "SKU" in {?GrpBy} then
{table.SKU}

Insert groups on these in the above order and, in the section expert, format each group header to "suppress blank section". If any of the values are numbers, you would need to also add a suppression formula for the groupname like this:

val(currentfieldvalue) = 0

-LB
 
Thank you for the suggestions. I'm not entirely sure if I did what either of you suggested but took more of a combination approach.

I created a inserted a section below each of my groups so each one has both a Group Header A & B. I then conditionally suppressed each section.

For example, the second group header will conditionally suppress if {?Group 2} = "No Group" or drilldowngrouplevel = 1. The third group header is {?Group 3} = "No Group" or drilldowngrouplevel = 2. This way, if "No Group" is selected the current group will be suppressed. Also, if "No Group" is selected the 'next' group will be suppressed due to the preceding DrillDown level.

Thanks again.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top