beautypg.com

Null handling – HP Intelligent Management Center Standard Software Platform User Manual

Page 617

background image

Using command objects as list-of-values data sources

Crystal Reports supports command objects as data sources for unmanaged
lists of values. To use this feature, you first create a command object using
the Database Expert to return the values that you want in your list-of-values
object.

For more information see "Defining an SQL Command" in the online help.

The query you create should return at least one database field per level in
the new list-of-values object. For example, if you want to build a Country,
Region, City list-of-values object, your query should return at least three
columns from your database: Country, Region, and City. You need to return
all three values in a single select statement. There is no need for an order
by clause, because the prompting engine sorts the values according to your
specifications.

Note:

It is not necessary to link your command object to your report fields. In
general, command objects that you use only to populate lists of values do
not need to be linked to your report. However, if you want to use a column
from this command object in your report, you need to link the command
object to the report.

All the command objects defined in your report appear in the value fields
drop-down list, and in the description fields drop-down list in the Create New
Parameter dialog box. You can then associate your list of values with the
command object.

Null handling

Null values in the data returned by the list of values are displayed as "null"
in the drop-down list for that prompt. Your users can select these values,
and any parameters associated with that prompt receive the null value. You
can test for this functionality in the Crystal Reports formula language with
the IsNull function.

For more information, see "IsNull (fld)" in the online help.

Crystal Reports 2008 SP3 User's Guide

617

23

Parameter Fields and Prompts

Working with lists of values