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

drill down headings on subreport 1

Status
Not open for further replies.

luzippu

Programmer
Sep 2, 2003
24
GB
Crystal v. 8.5

I have a subreport placed in the GH3 of the main report.

The subreport only shows a tot count and a tot sum of the details within the subreport.

The headers for these two fields are included in the main report's PH.

When I drill down on the subreport to view the details fields(which are the 2 fields that created the count and the sum + others not included in the group header), how can I show new headers for these extra fields without showing them on the main group?

ie: is there a way to suppress a section that contains headers "if not in drill down"?

hope I was clear,

thanks a lot.
 
First, please describe your subreport in a little more detail. Is there grouping in the subreport? If so, how many groups? Also, when you say "when I drill down on the subreport", do you mean after you've double-clicked on the subreport and it's appeared in it's own tab? The reason I ask is that the first "drill down" you do from the main report won't expose any more detail than you originally saw in the main report. It's only from the subreport tab in the Crystal viewer that you could then drill into the detail (assuming the detail has been hidden).
 
Sorry about that:

the subreport consist of:
RHc: where the header fields are hidden.
GH1: Region group, linked to the main rpt, no fields.
GH2: Sector group, linked to the main rpt, no fields.
GH3: Country group, linked to the main rpt, with 'count of orders' and 'sum of value' fields.
Da: this details section includes all formula fields which don't need to be shown on the drill down.
Db: this details section includes all fields which I would like to show on the drill down (Order no, Value, Cust Name, Address 1, etc.).
GF3: empty
GF2: empty
GF1: empty
RF: empty

Yes, when I mention "drill down on the subreport", I mean after I've double-clicked on the subreport and it's appeared in it's own tab. Infact, as you said, the first "drill down" from the main report won't expose any more detail than originally saw in the main report.
It's only when you double-click the summaries again on the new tab that you get the drill down of the details.

Now, at this stage I would like the new tab to show:
RHc: with all the headers related to Section 'Db'(and not only 'Orders' and 'Value').
Db: with all fields as described above.

Instead what happens is that I can see the details only and not the 'RHc' section with all the headers.
At the same time I cannot select 'show' on the 'RHc' section as this will also show on the main report for each 'GH3'.

Hope this is clearer and thanks again.
 
Ok, so if Country is a linked field to the main report, then the subreport will be for only one country (and sector and region). So, you can implement the following:

In the subreport, add a new section to GH3, so you have a GH3a and GH3b. GH3a should be (initially) empty and GH3b should contain the count of orders and the sum of value fields. In GH3a place the headings you want for the details section.

Create 3 formulas in the subreport:

InitDrillCount
--------------
whileprintingrecords;
Global NumberVar DrillCount := 0


IncrementDrillCount
-------------------
WhilePrintingRecords;
global numbervar DrillCount := DrillCount + 1

CheckDrillCount
---------------
WhilePrintingRecords;
global NumberVar DrillCount;


Place the formula InitDrillCount in the report header.
Place the formula IncrementDrillCount in GH2
Place the formula CheckDrillCount in GH3a.

Use the section expert and enter the following formula in the x+2 formula editor for the Suppress (no drill-down) option:

WhilePrintingRecords;
{@CheckDrillCount} <> 0

What happens is that when the subreport initially prints, the variable DrillCount has a value greater than 0 by the time the first GH3a is encountered. But when you drill down into GH3, Crystal doesn't track the variable inside the drill down tab. See it is evaluated as zero. The result is that GH3a prints, showing the headings you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top