zondag 13 oktober 2013

Crystal Reports: Graph with Different Colors Below and Above Norm

A graph in Crystal Reports with different colors when the revenue values are above the norm or when they are below the norm.


The graph is based on the tables Orders and Order_Details from the database Northwind.

  • Formula Field Revenue:
{Order_Details.Quantity}*{Order_Details.UnitPrice}
  • Group on Orders.OrderDate per Month.
  • Summary on Formula Field Revenue for the created group.
  • Formula Field RevenueAbove:

if Sum ({@revenue}, {Orders.OrderDate}, "monthly")> {?prmNorm} then
    Sum ({@revenue}, {Orders.OrderDate}, "monthly")
else
    0
  • Formula Field RevenueBelow:
if Sum ({@revenue}, {Orders.OrderDate}, "monthly")<= {?prmNorm} then
    Sum ({@revenue}, {Orders.OrderDate}, "monthly")
else
    0
  • Parameter Norm, type Numeric.
  • Formula Field Norm:
{?prmNorm}
  • Created a Line Chart with the data:

  • Changed the lines for revenueabove and revenuebelow into Risers.
  • Picked nice colors.
You can dowload the file here: www.walmar.nl/zips/graphbelowabove.zip

You can also download the file through this link:

https://drive.google.com/folderview?id=0B7HgkOwFZtdZVmhRQUZFM28yc1U&usp=sharing
Een reactie posten