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

Drill-down not doing what I expect - CR8 2

Status
Not open for further replies.

jdwalton

Programmer
Jun 13, 2003
10
US
I am relatively new to Crystal reports and I am finding that the drill down is not giving me the results I expect. I can attach the file if necessary but I will try to clarify what I am doing first. I have 2 groups, group 1 is carrier code and group 2 is Lane.

The page header shows the title and text box headings for carrier code and lane. Group header 1 shows group 1 name field. Group footer 2 shows the summary of the lane for each carrier.

Group header 2 shows the column headings for the detail and the detail section, of course, shows the details. GH2 and detail is suppressed with drill down ok.

If I double click a row in GF 2, then I am shown GH2 and detail, which is what I want. if I double click GH1, I am shown GH1, GH2 and GF2, which is not what I want. I would like to see the drill down detail and have it grouped by GH1.

Is there something I can do to achieve this?

OR

Can I do something to disable drilldown on GH1?

I am using CR8

Thanks for all help, I appreciate it.
 
I think you are hoping for a different sort by excluding Group2 on drilldown from the Group 1 Header, and I don't think that's possible--I think you'd have to add a subreport to accomplish that. And with 8.0 you don't have the control over suppression during drilldown that you would have in 9.0, so I'm not sure you could even suppress the Group 2 headers if you wanted to.

You can, however, prevent drilldown in the Group 1 header by placing the group header fields in text boxes. Clicking on them will then no longer result in drilldown.

-LB
 
Actually, you could control the suppression in the 2nd Group, with variables, but would you get the result you want? The 2nd Group would still exist in the drill down of GH1, and therefore the sorting of the details would not be solely with GH1. For example, consider the following data where Group 1 is Country and Group 2 is Region:

GH1: USA
GH2: CA
DTL: Irvine
DTL: Santa Ana
DTL: Westminster

GH2: WA
DTL: Seattle
DTL: Tacoma

If you were able to just show GH1, and the details, it would look like:

USA
Irvine
Santa Ana
Westminster
Seattle
Tacoma

However, one would, I would think, really want to see:

USA
Irvine
Santa Ana
Seattle
Tacoma
Westminster

Is the first sorting acceptable? If it is, I'll post the process for getting the sections to display as you have described.

If not, I think the answer for getting GH1 is to do an on-demand subreport associated with GH1.

 
Thanks for both responses! FVTrainer, I like where you are going with this, it looks like what I have in mind. When clicking GH1, I want to view the detail that is suppressed. Currently, the drilldown on GH1 shows GH2 and GF2. Can you give me more detail on drilling down from GH1 so that it will show the detail, as in your first example? I appreciate it.

Jim
 
Ok, just as an overview, the report will use a combination of drill-down and conditional suppression to simulate drill down. It will use formulas and variables to track whether or not a section should be displayed.

In terms of the settings for drill-down, here is how your group headings and details should initially be set up:

GH1: display (i.e., no setting for drill-down or suppress)
GH2: set to hide
Details: display
GF2: display
GF1: display

Next, create the following formulas:

DrillDownFlag
-------------
WhilePrintingRecords;
global BooleanVar InDrillDown := True;

InitDrillDownCount
------------------
WhilePrintingRecords;
Global NumberVar DrillDownCount := 0;

IncrementDrillDownCount
-----------------------
WhilePrintingRecords;
Global NumberVar DrillDownCount := DrillDownCount + 1;


Place {@DrillDownFlag} in the report header.
Place {@InitDrillDownCount} in the report header as well.
Place {@IncrementDrillDownCount} in GH1.

After you've seen how everything works, you'll probably want to suppress the display of each of these formulas.

Open up the Section Expert. Click on GH2 and then click on the X+2 button for the "Suppress (No Drill-Down) option. Enter the following formula:

WhilePrintingRecords;
Global NumberVar DrillDownCount <> 0

Save the formula. In the Section Expert, select the Details section and open its conditional formula for the &quot;Suppress (No Drill-Down)&quot; option. Enter the following formula:

WhilePrintingRecords;
Global BooleanVar InDrillDown = True;

Save the formula. Once again, in the Section Expert select the GF2 section and edit its conditional formula for the Suppress option. Enter the following formula:

WhilePrintingRecords;
Global NumberVar DrillDownCount;
Global BooleanVar InDrillDown;
(DrillDownCount <> 0 and InDrillDown <> True )

That's it. You should now get the results I described in my first post.

By the way, the reason the variables work as trackers is because, for some reason, Crystal loses track of a variable's value in the Drill-down if the value was set in a level (or group) that is not displayed in the Drill-Down window. So, for example, the variable InDrillDown evaluates to False in all drill-down tabs because there is no report header in a drill down (at least in CR 8.5). Likewise, the variable DrillDownCount evaluates to zero in GF2 while in a Drill-down of the 2nd Group because it's initial value gets set in GH1 which doesn't exist in the drill-down tab of GH2.
 
That's excellent! Thank you. That part works like I need it to. Once this is finished, I need to absorb everything you have taught me so I fully understand it.

Now as a result of these changes, the drilldown from GF2 is not showing the raw detail. I hope what I'm going to ask makes sense. Originally, GF2 was displayed in the main report, and still is, and I could drill down on GF2 to see the actually detail of the summary fields in GF2. Now when I drill down thru GF2, I see GF2, not detail. It's ok to drill down from GH1 to GF2, as long as in GF2, I can drill down to detail. Ideally, I would like all drill down, both from GH1 and GF2 to drill down to detail. Is this possible? At the very least, I need to get it back to drilling down to detail from GF2.

Thank you very much for your assistance. This is valuable info for me because I have other reports to complete and I know I will encounter this scenario again.

Jim
 
Well, it seems to work fine on the report I modeled your scenario on. Please review the settings for GF2 and for the details section, as per my previous post. If you don't see a discrepancy between your report and the instructions, I could email you the sample report I used to proof out the concept. It uses the Xtreme Sample database, so you should be able to run it.
 
Apparently, I missed something the first time, I couldn't find my discrepency, but I started over and redid everything it now works exactly as I need it to. Thank you very much for your patience with me, this is a huge hurdle for me that you have helped me overcome.

thanks again.

Jim
 
Does this work if you have the report options set to &quot;Show All Headers on Drill Down&quot;?
 
No, it does not. However, you could model your headers in separate sections of the group you are drilling into, using that group header to display the same info as shown in the other headers...it's certainly not as convenient, though, as &quot;Show All Headers on Drill Down&quot;.
 
Dear Friends, I am looking at a same sort of problem where I have multiple groups and I want to show one group at a time. I tried working with suggested option it works but the problem again is that I have 5 groups and one detail I am able to hide G2, G3,G4 and G5 in the initial G1 display but once I click on G2 to move from G1, G1 is also displayed there with G2 and in G3 its G1 G2 and G3.
Is there any settingor equation by which I can put the earlier visited groups to supress. Kindly help this is very urgent

Thanks

Vijkid


 
Hmm... I've tried this, and it work fine, with one slight problem. On the very first instance of the group, the hidden header is still shown on the report. After that, it works great. Thanks for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top