Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Restrict Records from Parameter Post Reply Post New Topic
Author Message
bremen
Groupie
Groupie
Avatar

Joined: 28 May 2013
Online Status: Offline
Posts: 93
Quote bremen Replybullet Topic: Restrict Records from Parameter
     Posted: 11 Aug 2014 at 4:15am
I have a dynamic parameter that shows user names.  Currently it shows every user (as it should) but I would like to restrict it based on the users department. 

For example I have 5 departs total.  I only want users from departments 1,2 and 4 to be available for selection from the parameter. 


IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 11 Aug 2014 at 4:58am
Create an additional parameter. Choose the Department field as the Value Field. For the Values, click 'Click here to add item' and add each parameter value you want to be available. Set Allow Custom Values to False, Allow Multiple Values to True and Allow Range Values to False

Click Report, Selection Formulas, Record. Add:
{table.departmentfield}={?DepartmentParameter}


Edited by FrnhtGLI - 11 Aug 2014 at 5:00am
|< /\ '][' ( )
IP IP Logged
bremen
Groupie
Groupie
Avatar

Joined: 28 May 2013
Online Status: Offline
Posts: 93
Quote bremen Replybullet Posted: 14 Aug 2014 at 3:25am
I followed these steps and I am seeing another choice for the department on the parameter screen.

I am wanting this to be transparent to the end user.   


IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 14 Aug 2014 at 3:59am
If it is not conditional on the user running the report you need to change the source of the parameter list to a filtered source, like a command, or a view or a stored proc.
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