Introduction
During development there are chances that a person
might encounter a problem of how to
display colored rows in a crystal report, where colors themselves might
actually represent something. I encountered this problem and was searching for
solutions on the web but couldn’t find any. But in the end I cracked it, so I
thought why not share it, so here goes. <o:p>
Details
Shown
above is an extraction from the report I was creating. To achieve such
functionality you’d have to open the Section Expert from the Details Section.
Then select the Color tab and then click on the formula button.
This would open the Formula Editor where you can
specify the different conditions on to which the appropriate colors can be
displayed. For more details on the available colors expand the Functions tree
item in the Functions Tree, and look for the Color Constants tree item.
Expanding it would reveal the list of supported colors.
<o:p>
<o:p>
The formula that I have used here is as follows:<o:p>
if({AgingList.Total}>({AgingList.Principal}+{AgingList.Profit})) then Crgreen
else if({AgingList.Total}=0) then Crblue
else if({AgingList.Total}<({AgingList.Principal}+{AgingList.Profit})) then CrYellow
else NoColor
(Note: Don’t forget to assign the NoColor color to
the rows which do not fit to the requirements for the coloured lines else they
may defaultly be displayed as blacked out.)
Save the report and Play. If all conditions
satisfied you should be able to see the desired result.<o:p>
<o:p>
Conclusion
This procedure should solve the problem of colored rows where ever intended in the report.
A small time software engineer with big time ideas. Helping others get their ideas on the road so that some day I can fuel mine.
Wannabe Software Designer, work in progress, obsessed with Aesthetics especially of Engineering.
Having spent over 8 years writing software professionally I have, atleast tried to help, many companies build and improve on their existing business implementations. Having gone solo for a few years now, I am constantly on the look out for people with problems looking for someone to help solve them whilst building a strong lasting professional relationship in the process.