Chapter 5: Using Formulas


Overview

When you first start using Crystal Reports, you ll be able to write some simple reports using data that comes entirely from the database. You simply drag fields from the Field Explorer onto the report, and away you go. However, it won t be long until you find that you want some information to appear on your report that isn t contained in the database. Or, you may find that you want to display a field differently on the report than it appears in the database. For these, and many similar situations, use Crystal Reports formulas.

A formula can be thought of as a math calculation or a small piece of computer programming code. If you re not used to them at first, creating formulas can appear to be very complicated. Depending on your background, you may like the fact that some formulas are very much like programming, or this may be one characteristic of formulas that you would prefer not to deal with. Formulas can be as simple or as complex as you want to make them ”you can start with simple math computations and, as you get more comfortable, graduate to full Basic-like formulas using Case statements, variables , and other advanced programming techniques. You can even share your formula expertise with your coworkers using Crystal Reports custom functions (covered in Chapter 6) and the Repository (covered in Chapter 7). Formulas bring the ultimate power and flexibility to Crystal Reports.

You can create formulas with either the Design or the Preview tab displayed, although creating them in the Design tab is probably better because you will have a more accurate idea of where the formulas will really end up when you place them on your report. You may create a new formula or modify an existing formula in two places in Crystal Reports ” either the Field Explorer s Formula Fields category, or from the Formula Workshop.




Crystal Reports 10
Crystal Reports 10: The Complete Reference
ISBN: B005DI80VA
EAN: N/A
Year: 2004
Pages: 223
Authors: George Peck

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net