Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Command - Parameter - Multiple Values Post Reply Post New Topic
Page  of 2 Next >>
Author Message
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Topic: Command - Parameter - Multiple Values
    Posted: 21 Jan 2020 at 10:09am
I was given a report that was written quite some time ago and by someone else. I was challenged with figuring out why the IPA parameter used in this report, won't accept multiple values. I thought it would be a matter of editing the command, selecting the parameter and marking the box that says "Allow Multiple Values"....well that didn't work! Here is the part of the command I think that is having the problem. Is there something I need to change in this statement also, to allow multiple values to be chosen using this parameter?

WHERE
amv.meh_ipa_id = ipam.ipa_id and
     ipam.ipa_id=ipax.ipa_id and
               amv.auth_number = am.auth_number and
     amv.auth_status in ('OP','NW','HD','CL') and
     amv.admit_date <=
---decode({?date},to_date('1800,01,01', 'YYYY,MM,DD'),sysdate,{?date})
               decode({?Date},to_date('1800,01,01', 'YYYY,MM,DD'),sysdate,
               decode({?Date},to_date('1900,01,01', 'YYYY,MM,DD'),sysdate-1,{?Date}))

and
     (amv.disch_thru_date >=
---decode({?date},to_date('1800,01,01', 'YYYY,MM,DD'),sysdate,{?date})
               decode({?Date},to_date('1800,01,01', 'YYYY,MM,DD'),sysdate,
               decode({?Date},to_date('1900,01,01', 'YYYY,MM,DD'),sysdate-1,{?Date}))
           or amv.disch_thru_date is null) and
     amv.auth_type = '{?AuthType}' and
                 ipax.ipa_parent_id = '{?IPA}') Auths
Always appreciate the help!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Jan 2020 at 6:11am
Is your parameter a dynamic parameter?
Is your issue literally not being able to select more than one item from the parameter or that it is not filtering based on that selection?
IP IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Posted: 23 Jan 2020 at 6:34am
It is not a dynamic parameter, it's static which I just verified. Should it be dynamic

Yes the issue literally is not being able to select more than one item from the parameter.
Always appreciate the help!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Jan 2020 at 7:49am
In the parameter set up screen under Value Options there is a option called 'Allow Multiple Values'. Set it to True
IP IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Posted: 23 Jan 2020 at 8:50am
I tried that right off the bat and it will not let me change that value to True.
Always appreciate the help!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Jan 2020 at 8:53am
Not sure why but that is what controls it.
Is the parameter a data source parameter or one created in Crystal?
IP IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Posted: 23 Jan 2020 at 9:03am
The parameter is created in Crystal, under Parameter Fields yet it also lies within the command.

When I go to edit the command, there are 3 parameters also there and one of them is this IPA one that I wanted to change. That's why I though it was originally something with the command.

One co-worker offered this opinion below:
*****
I don’t know for sure, but it might be a problem with this statement:

and
     (amv.disch_thru_date >=
---decode({?date},to_date('1800,01,01', 'YYYY,MM,DD'),sysdate,{?date})
               decode({?Date},to_date('1800,01,01', 'YYYY,MM,DD'),sysdate,
               decode({?Date},to_date('1900,01,01', 'YYYY,MM,DD'),sysdate-1,{?Date}))
           or amv.disch_thru_date is null) and
     amv.auth_type = '{?AuthType}' and
                 ipax.ipa_parent_id = '{?IPA}') Auths


The line would normally be something like ipax.ipa_parent_id = ‘Value’.   It looks like the way to reference the parameter is {?IPA}….   So if you make it ‘{?IPA}’ then I think it might partially fix your issue—notice there is an extra ending parenthesis right now that I think needs to be removed.

******

However, removing, adding the parens didn't work either from his opinion.
Always appreciate the help!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Jan 2020 at 10:22am
If the parameter is being created in the command and passed to crystal it might not allow for multiple values.
I'd make a copy of the report then.
Create another parameter in crystal call it IPA2, and set it to allow for multiple values. IF that allows you to do it then use it (?IPA2) in the crystal select. I'd then edit the command to remove any reference to the other @IPA.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 23 Jan 2020 at 10:32am
This blog post has a lot of good information about how to use parameters with Commands: https://blogs.sap.com/2015/04/01/best-practices-when-using-commands-with-crystal-reports/.

There are a couple of problems with how the Command is configured:

1. If you have a multiple-select parameter, you don't need the quotes around it.
2. Change "=" to "in"
3. Edit the parameter in the Command Editor - that's where you'll find the option to make it multi-select.

-Dell
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Jan 2020 at 2:19am
Thanks Hilfy, I never use Commands so this is great reference material.

Edited by DBlank - 24 Jan 2020 at 2:19am
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.008 seconds.