Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Values In Parameter

Status
Not open for further replies.

LucyColey

Programmer
Apr 30, 2001
34
0
0
US
I remember reading something about this a while ago, but can't find it when I need it of course. I have a parameter in V8 that allows multiple values and I would like to display those values selected in the report header. How do I extract that? I place the parameter on the report, but it doesn't show everything selected.
 
Dear Lucy,

Assuming you are using version 8 - there is a article on the knowledge base for Crystal Decisions/Crystal Reports - c2005353 - that details how to do this - but for the rest of the web public, excepts from that article are here below:

Solution

Only the first value of a multiple value parameter displays because Crystal Reports stores multiple parameter values as an array, and Crystal Reports does not output arrays.

To successfully display all values of a multiple-value parameter on a report, use Crystal Reports 8's new JOIN function to display an array of values separated by a user-defined separator.

To display a multiple value parameter with the JOIN funtion:

NOTE: =====

The formula described below only works for multiple discrete values. It does not work with multiple range values.

===========

1. On the 'Insert' menu, select 'Formula Field'. The Field Explorer appears.

2. Click the 'New Formula' icon. The 'Formula Name' dialogue box appears.

3. Enter your formula name and click 'OK'. The 'Formula Editor'appears.

4. Type the below formula:

//{@DisplayParam}

// {?Parameter} is a place holder for this example.
// Replace {?Parameter} with your own
// parameter when inserting this formula onto your report.

// To change the separator,
// change the character between the quotes.

Join({?Parameter}, ", ")

5. Click the 'Save and Close' icon.

6. Insert the {@DisplayParam} formula field on the report instead of the parameter field.

The next time you preview the report, all the parameter values display.

Cheers,

paulmarr@arcom.com.au
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top