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!

Using range / multiple value parameters 1

Status
Not open for further replies.

pennyb01

Technical User
Jul 8, 2007
12
0
0
GB
Hi. I am using Crystal Reports XI R2 and am trying to create a "packing list" report which will group together multiple shipments into one report.

Herein lies my problem:

I have created a parameter and allowed multiple discrete values. Is there a way of referring to only one of these discrete values for the header details of the report, whilst pulling the report details from all values?

Any help would be appreciated!

Thanks,

Penny

 
Can you be more specific about what you are trying to do? How do you know which parameter value to display in the header (and do you mean the report header?). I think if you use examples it will be easier to follow.

-LB
 
Since the parameter is a range once there are multiple values, you can use:

minimum({?MyParameter})

to get the first.

LB brings up the obvious point, you state you want one, but not whether it's just a random choice, specific, or you just haven't thought it through yet and are asking for help.

To display them all, use a formula containing:

join({?MyParameter},",")

-k
 
Thanks for your comments LB and Synapsevampire (and I am sorry it has taken me so long to get back to you - I was pulled on to other things).

To clarify, I am trying to populate my report header. I have a parameter called {?Pm-Despatch_Notes.Despatch_Note} which I have set to take multiple values. I need to show all of the values that have been selected for this parameter in the report header. To achieve this, I have done as you suggested and written the formula:

JOIN ([{?Pm-Despatch_Notes.Despatch_Note}],",")

However, I get an error message saying:

"This array must be subscripted. For example Array"

Please could you help me? I have tried the Crystal Reports help, but am getting nowhere....

For info., my parameter is a string.

Thanks again!

Penny
 
Your formula is showing a linking field for a subreport. Please explain where the subreport is located, how it is linked to the main report, and whether you want to show the parameter selections in the report header of the main report or the subreport.

-LB
 
Hi LB,

I created the parameter name like this - this particular one is not linking into a subreport. I need the parameter selections to show in the report header of the main report. Do you know how I can achieve this?

Youe help is appreciated!

Thanks,

Penny
 
So you entered a name like "Pm-Despatch_Notes.Despatch_Note" when you created the parameter in the field explorer? I wouldn't do that, as it is confusing a parameter with the characteristics of a linking field.

Anyway, if it is in fact a regular parameter, then trying removing the brackets, so that it reads:

join ({?yourparm},",")

...which is the usual way of joining a multiple value string parameter.

-LB

 
I just noticed that you mention "range" in your thread title. Is the parm set to allow range values as well? That might be the problem.

-LB
 
I originally set the parameter to have a range and multiple values, but have since changed to multiple values only..... With this change, I am still unable to show all the values entered for the parameter....

Thanks,
Penny
 
Sorry, missed your previous reply: When I remove the brackets so that I have

join ({?Pm-Despatch_Notes.Despatch_Note},",")

I receive an error message saying

"A string array is required here" .....

Penny
 
I think you should verify the datatype of your parameter and also that you have removed the allow range values requirement. I recreated your name with a string parm, and the solution still works--unless I change it to allow range values.

-LB
 
Herein may lie the problem: The parameter is a number, not a string..... What is the best way of showing the multiple values of a numerical parameter?

Thanks!
 
I tried a formula as below:

{?Despatch Notes}[1 to (count({?Despatch Notes}))]

However, received an error message in return saying that the output could not be an array.....
 
Use a formula like this:

numbervar i;
numbervar j := ubound({?parm});
stringvar x;

for i := 1 to j do(
x := x + totext({?parm},0,"")+", "
);
left(x,len(x)-2)

-LB
 
It works!

Thank-ypi very much for your help LB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top