|
|
Crystal Reports:
Display CR or OD on Negative Numbers
The current choices to display a negative number are to use
a minus sign or to add brackets around a negative number.
Back in our old COBOL programming days, we often wanted to
display a negative number with a “CR” suffix. A bank might want to display
“OD” if your account balance dipped below zero.
If you want to do this in your crystal report you can use
the display string conditional formatting option. To display a CR against
negative numbers use this conditional format
if CurrentFieldValue >= 0 then Totext(CurrentFieldValue)
+ " "
else Totext(abs(CurrentFieldValue)) + "CR"
One of the things to be careful about is that we really like
to see numbers line up on the decimal place. With some fonts, each character
has a different width. So you might need more than two spaces to get the
alignment correct. Our test report found that four spaces worked well in
Arial 10 point. You might need to experiment a little if you use a different
font or size.
Another option which may work for you is to forego numbers
altogether and use graphs instead. Since the purpose of a Crystal Report is to
provide business intelligence rather than raw data, this is usually the better
way to go.
We have a tool that can help you make extremely useful charts.
It's called
CR Chart.
With this outstanding product, you can:
- Set chart properties at runtime
- Create boxplots, Pareto Charts, error bars, and
waterfall charts
- Use pivot functions--swap series/group, data
reversal, and so on.
- Use conditional logic
- Create wow factor with drop shadow and alpha
channel transparency effects.
Have superior control over:
- Axis labels: skipping, decimal precision, scale
range, etc...
- Color of markers and risers.
Take advantage of user-programmable:
- Lines on any axis (or free floating)
- Markers/labels at any point on the chart
- Label names and user-defined datasets.
And, of course, you can use this along with some good formatting
to achieve stunning look. Thoughtful formatting enhances the usability of your Crystal Reports. For even
more functionality, you can use third-party programs, such as the ones
available here. All that said, here's a caution. Don't get carried away with formatting. A
report is not the place to demonstrate how many formatting techniques you can
use.Instead, you want to use the formatting to accomplish such goals as:
- Present a clean but compelling appearance.
- Guide the reader's eye to what's important. That means very little
highlighting or bolding.
- Separate information or visually group it.
- Make the report consistent with other company literature. For example,
use company colors, company logo, and the official font (if there is one).
- Create a different flavor or appearance for each type of report. For
example, financial reports have a green border, sales reports have a salmon
border, production reports have a blue border, and so on.
- Show what has changed.
- Highlight problem areas.
Avoid common color usage errors
- Don't just add colors gratuitously. Think of them as spices. They need
to bring out the flavor of the report, not bury it. And they need to work
together. Some spices clash when used together, and so do some colors.
- A common mistake with colors is to use large blocks of colored text on
the page. For example, yellow on a black background. You get maximum
readability with black text on a white background. You can use colored text
to emphasize or to bring out headings (or subheadings). But when used for
the main body of the text, it actually detracts from the report.
- Don't use colored page backgrounds. When people try to print these out,
the page becomes saturated with ink and paper jams result. With duplex
printers, the problem is twice as bad.
- Use contrasting colors. Many people can't see the difference between two
closely related light blues, for example. Variations in printing also cause
confusion. Then there's the issue of referring to the color. Bob in
Accounting is discussing the report. He can easily ask Beverly compare the
total that appears in dark blue text to the total that appears in dark brown
text. But how can he refer to the total in tan versus the one in light
brown?
- Avoid red backgrounds. These irritate the eye.
- Remember, color costs money. Use it where there's a return on that
investment (no need to calculate ROI).
- If there's no particular reason to use color, don't use it.
This article is copyrighted by
Crystalkeen, Mindconnection, and Chelsea Technologies Ltd. It may be
freely copied and distributed as long as the original copyright is
displayed and no modifications are made to this material. Extracts are
permitted. The names Crystal Reports and Seagate Info are trademarks owned
by Business Objects.
|