Crystal reports user guide

Page 348

Formulas overview

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.

What’s new in the formula language Many new features have been added to the formula language for this version of Crystal Reports.

Custom functions Custom functions are procedures you write that are independent of the report they are being used in. They provide a way for you to share and reuse formula logic across reports. This makes it easier and less time consuming for you and your users to create usable reports. Custom functions can be written in Crystal or Basic syntax. A report can contain custom functions of both syntax types. To use a custom function in your report, you’ll need to call it from a formula you’re using. The syntax of the formula calling the custom function is not relevant when determining the syntax of the custom function you are calling. For more information see Working with custom functions in the online help. Custom functions and the Crystal Repository Custom functions can be shared across reports using the Crystal Repository. You can save a custom function to the repository and then copy that custom function into a different report. You can also keep your custom functions connected to the repository and automatically update your report with the latest version after you modify them. Note: The Crystal Repository is not available in all version of Crystal Reports. Sample custom functions Crystal Reports ships with sample custom functions that can be found in the Crystal Repository and in the sample report Custom Functions.rpt. Also see Custom function examples in the online help.

Increased limits Formulas can now work with memo fields, and they can now process strings up to 64K in length, as opposed to a string-size limit of 255 bytes in previous versions.

330

Crystal Reports User’s Guide


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.