beautypg.com

Formulas overview, Typical uses for formulas – HP Intelligent Management Center Standard Software Platform User Manual

Page 554

background image

Formulas overview

In many cases, the data needed for a report already exists in database table
fields. For example, to prepare an order list you would place the appropriate
fields on the report.

Sometimes, however, you need to put data on the report that does not exist
in any of the data fields. In such cases, you need to create a formula. For
example, to calculate the number of days it takes to process each order, you
need a formula that determines the number of days between the order date
and the ship date. Crystal Reports makes it easy for you to create such a
formula.

Typical uses for formulas

There are many uses for formulas. If you have a need for specialized data
manipulation, you can do it with a formula.

Creating calculated fields to add to your report

To calculate a price discounted 15%:

Crystal syntax example:

{Orders_Detail.Unit Price}*.85

Basic syntax example:

formula = {Orders_Detail.Unit Price}*.85

Formatting text on a report

To change all the values in the Customer Name field to uppercase:

Crystal syntax example:

UpperCase ({Customer.Customer Name})

Basic syntax example:

formula = UCase ({Customer.Customer Name})

554

Crystal Reports 2008 SP3 User's Guide

Using Formulas

22

Formulas overview