Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Dynamic parameters based on another parameter Post Reply Post New Topic
Author Message
duskfire
Newbie
Newbie


Joined: 30 Sep 2011
Online Status: Offline
Posts: 8
Quote duskfire Replybullet Topic: Dynamic parameters based on another parameter
     Posted: 13 Oct 2011 at 4:14pm
Hi,

I have a requirement to display dynamic parameter based on a value entered in another parameter field.

For example: I have two input parameters "userid" and "codes". Based on userid i want to display dynamic values in "codes" parameters field.

Is this possible at in Crystal Reports 2008? I tried but "codes" field displays no values at all.

Any input will be greatly appreciated.

Thanks,
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 14 Oct 2011 at 4:45am
I am not sure how your data is set up, but using a command object as an example (i am assuming that there are users, codes, and some way of identifying which codes go to which users)
 
select user, code from userTable ut join userCodeTable uct on ut.userID = uct.userID join codeTable ct ON ct.codeID = uct.codeID
 
 
then set up the parameter to cascade using the Command object as a datasource. Selecting first user will then filter and display the codes for that user.
 
HTH
IP IP Logged
duskfire
Newbie
Newbie


Joined: 30 Sep 2011
Online Status: Offline
Posts: 8
Quote duskfire Replybullet Posted: 14 Oct 2011 at 8:56am
Thanks for your reply, HTH.
 
This is my situation. We have a vendor application which provides us with a report viewer. When I try to open a report, they pass in the user id to the stored procedure. I need to use this user id to determine his level of access and display codes in the next parameter. In a way, we are requesting values for both the parameters at the same time. Is this possible?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 17 Oct 2011 at 12:05pm
Hmmm....
 
Not what I am used to but that is the fun...
 
Does the userID appear as a parameter in the report, or is it passed to a stored proc and the results of the stored proc displayed?
 
If the userID is available prior to the report being run, you can probably use it select the data that you want using a command object.
 
Again, it is not something that I have needed to do, and others have reported that CR may request a value for the parameter before the report will get very far(because of the command object) but this would seem to be good case for the command object.
 
HTH
IP IP Logged
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