Symptom
The final goal is to eliminate repeating upper level fields in hierarchy report. For example: report has the following records:
LEVEL1
LEVEL1
LEVEL2
LEVEL1
LEVEL2
LEVEL3A
LEVEL1
LEVEL2
LEVEL3 B…
The goal is to get the following records
LEVEL1
LEVEL2
LEVEL3A
LEVEL3B
Environment:
Crystal Reports 10,
Crystal Reports XI,
Crystal Reports 2008
Resolution
There is a function in Crystal Reports to define hierarchy level: HierarchyLevel
And we can remember the upper level value within an array with the following formula:
//FORMULA1
stringvar array SupLevel;
redim preserve SupLevel [50];
if suplevel[HierarchyLevel(GroupingLevel({getResultSet.MGR_PERSONNEL_ID}))]<> {getResultSet.SUP_LAST_NAME} then
suplevel[HierarchyLevel(GroupingLevel({getResultSet.MGR_PERSONNEL_ID}))]:={getResultSet.SUP_LAST_NAME};
then suppress the hierarchy field using the following suppression formula:
FORMULA2
stringvar array SupLevel;
redim preserve suplevel[50];
HierarchyLevel(GroupingLevel({getResultSet.MGR_PERSONNEL_ID}))> 2 OR
suplevel[HierarchyLevel(GroupingLevel({getResultSet.MGR_PERSONNEL_ID}))]= {getResultSet.SUP_LAST_NAME}
Keywords
KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , How To
Product
Attachments
AccountManagerTree.rpt |