Displaying a Drill Down Path with various colors in Crystal Reports xi.

DrillDownGroupLevel
Definition- DrillDownGroupLevel is a system defined function in Crystal Reports ,that returns the current drill down level in the report that one is working upon. DrllDownGroupLevel can be used efficeintly and dynamically to achieve more interactivity and dynamism in a report.

Returns-Number (drill down group number).

Can be Used with:Formula Fields,Database fields,Text Fields.

Not compatible with:Custom report functions.

Drill path:Text Path showing the drill down in the running report.

Requirement: I wanted to display the Drill Path in different colors i.e 1. Blue-Currently active Drill down Group(s).

2.Gray-Curently not active drill down group(s).

3.The whole report should yield a proper alignment when exported to Excel (xls).

Conclusion :

Crystal report xi doesn’t support formatting a specific part of a string with a color of a specific choice based on a specific condition or not based on any condition. Crystal reports xi aligns the objects according to the x,y coordinate values.When the whole thing gets exported to formats like PDF it appears as it is because viewing applications like these follow a WYSIWYG (What You See Is What You Get)format.But with excel the things are different as it aligns the whole thing using indents,so things at the end of the day can be a mess.

Solution:

Create a new formula –> Name it as per ur choice  –>  Enter the following code:

SWITCH( DrillDownGroupLevel=0,"Drill Path : DrillDownGroupLevel 0 > DrillDownGroupLevel 1 > DrillDOwnGroupLevel 2",

DrillDownGroupLevel=1,"Drill Path : DrillDownGroupLevel 0> DrillDownGroupLevel 1 > DrillDOwnGroupLevel 2",

DrillDownGroupLevel=2,"Drill Path : DrillDownGroupLevel 0 > DrillDownGroupLevel 1 > DrillDownGroupLevel 2",

TRUE,"Test result")

 After you are done writing the code –> Check for errors –>Click ‘Save and Close’ –>Design View –>Drag it and place it the Page header(or anywhere as per requirement (but not in the details section)–> Right Click on the formula field u just created –>Select Format Field from context menu–>Goto to Paragraph Tab–>On the ‘Text Interpretation’ drop down list select ‘Html Text’ –> Click ok and exit.
Explanation:  Instead of using system defined or customization, this can be achieved by using tag formatting with > DrillDownGroupLevel 1 to the resultant string.I formatted the whole returning string in the html format so the text was formatted with a color as per the html color formatting.

Happy Reporting,

150 150 Burnignorance | Where Minds Meet And Sparks Fly!