Symptom
A report contains a hierarchy. This hierarchy is based on a field within the database and is established using the Hierarchial Grouping options on the Report menu of Crystal Reports.
The report contains a group and a Detail section. The Details section is hidden so that only the names of the leves are displayed. The following structure is an illustration:
LEVEL1
LEVEL2A
LEVEL3AA
LEVEL4AAA
LEVEL3AB
LEVEL2B
LEVEL3BA
LEVEL2C
The requirement is to only display the direct and indirect children of LEVEL2A. The requirement is illustrated below:
LEVEL2A
LEVEL3AA
LEVEL4AAA
LEVEL3AB
Cause
Resolution
1 - In the above example the LEVEL2A is the group level number 2; so, create a formula " VariableX - to define a variable which is assigned to the first 7 letters of this group level - GroupNumber 2:
WhilePrintingRecords;
Global stringVar x;
if GroupNumber = 2 then
x:= Left({field_on_which_the hierarchy is defined},7);
2 - Create a new section of the group header 1 so as to have GH1a and GH1b;
3 " Move all the objects from the GH1b to the GH1a and in the GH1a place the "VariableX" formula;
4 " Suppress the GH1a section;
5 " Conditionally suppress the GH1b:
WhilePrintingRecords;
stringVar x;
GroupNumber = 1 or
if Left({field_on_which_the hierarchy is defined }, 7)= x then true
Keywords
hierarchy, Parent " Child relationship, relationship, level , 5637576 , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To