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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prompts

Status
Not open for further replies.

crystaldeveloper20

Programmer
Dec 4, 2001
5
US
Hello

I am using Crystal Reports 7 and I have a report that the user wants to see the prompts selected in the heading, No problem if the user selects 1 it will show the prompt in the heading; however, if the user selects more than one value for the prompt crystal will only show the first value selected. Has anyone ever encountered this and what have you done to get this to work. Here are some of the things I tried I could use a range and use the formula's MIN and MAX that would work but that would cause me to change the prompt properties from list of value to range. I also tried using an array which my attempt failed miserably. Any help would greatly be appreciated

Thanks
 
In the crystal report, create a formula field and use the Join() function. Join(?MultiValueField,delimiter) is the syntax.

Let me know if you have any problems Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
Hello

Thanks for the assistance I tried using the Join function; however, I donot think it is available for the version of Crystal Reports that I am using which is version 7 what version are you using?
 
I am on V8.5

Your alternative is to use a loop. Try the following code and see if it works:

Numbervar Counter;
StringVar RptHdrMessg:= "Items for this report ";

For counter = 1 to count({?MVParmField})
Step 1 do
(RptHdrMessg:=RptHdrMessg&{?MVParmField}[counter]+", ");

RptHdrMessg; Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
Hello

I tried to use the code as follows

Numbervar Counter;
StringVar RptHdrMessg:= "Julian Date ";


counter = 1 to count({?JULIAN DATE});
(RptHdrMessg:=RptHdrMessg + {?JULIAN DATE}[counter]+", ");

RptHdrMessg;

and I got the error message
a subscript must be between 1 and the size of the array.

I think now would be a good time to petition for an upgrade :)

Thanks for all your help
 
You left out the "for" before counter, not sure if thats the problem.

Also, please make sure that {?Julian date} is a multivalue parameter field, AND you entered more than one value for it. Let me know what happens. Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
Dgillz, For loops are only avaialble in CR8 and above.

I have many customers with similar parameter display criteria as crystaldevleloper20. Here is how I am able to display multiple selections in a Header:

ParamDisplay
//This formula is displays multiple selected parameters

IF COUNT({?PARAM}) = 1 THEN
'PARAM: ' + TOTEXT({?PARAM}[1])
ELSE IF COUNT({?PARAM}) = 2 THEN
'PARAM: ' + TOTEXT({?PARAM}[1]) +', '+ TOTEXT({?PARAM}[2])
ELSE IF COUNT({?PARAM}) = 3 THEN
'PARAM: ' + TOTEXT({?PARAM}[1]) +', '+ TOTEXT({?PARAM}[2])+', '+ TOTEXT({?PARAM}[3])
ELSE IF COUNT({?PARAM) >= 4 THEN
'PARAM: ' + TOTEXT({?PARAM}[1]) +', '+ TOTEXT({?PARAM}[2])+', '+ TOTEXT({?PARAM}[3])+", + Others"

The thing to remember, when you subscript arrays, is that you have to define each possible selection (out of how many?). In my case, I have limited real estate for this header so I've limited the display to 3 Params plus an 'Others' Category.

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top