Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Static and Dynamic Parameters Post Reply Post New Topic
Author Message
McWheels
Newbie
Newbie
Avatar

Joined: 16 Feb 2015
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote McWheels Replybullet Topic: Static and Dynamic Parameters
    Posted: 20 Feb 2015 at 12:36am
Is it possible to use static and dynamic parameters in the same report?

I have a static parameter for the first user selection, after that I use a dynamic parameter which needs to depend on the static parameter.

Example:

- User enters a project code (static parameter)
- A dynamic parameter then allows a user to select from a list of sub-projects, which are linked to the initial project code.

Is this doable in Crystal Reports XI, and if so, how could I go about implementing this solution?
M Wheels
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Feb 2015 at 6:35am
is there a reason you are not using cascading dynamic?
IP IP Logged
McWheels
Newbie
Newbie
Avatar

Joined: 16 Feb 2015
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote McWheels Replybullet Posted: 20 Feb 2015 at 6:45am
Not really, I have tried using standard dynamic parameters with little success.
How would you recommend using cascading dynamic parameters?
M Wheels
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Feb 2015 at 6:53am
if your data set allows for it (structurally) which I assume it does based on your first question...
set up the dynamic param to first select from the project codes field then the next value would be froom the sub projects field.
 
IP IP Logged
McWheels
Newbie
Newbie
Avatar

Joined: 16 Feb 2015
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote McWheels Replybullet Posted: 20 Feb 2015 at 7:55am
Unfortunately, the data set is structured so that the user must manually enter the initial project code as a static parameter, from which the dynamic parameters are driven to derive the sub tasks. Does that make sense?
M Wheels
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Feb 2015 at 8:09am

not really. If you can limit the available sub types based on a selection of a project code it should be able to be added as the a dynamic piece of data in the params

is this a stored proc where you a re using a param set to match the project code in the stored proc?
IP IP Logged
McWheels
Newbie
Newbie
Avatar

Joined: 16 Feb 2015
Location: United Kingdom
Online Status: Offline
Posts: 4
Quote McWheels Replybullet Posted: 24 Feb 2015 at 4:09am
Ok, well to clarify, here is the scenario.

We have approximately 14000 project codes.
Each of these projects has at least one sub-code.

What I am trying to do is have the user enter a single project code (as a static parameter).
Once they have done that, I’d like to use a dynamic parameter derive a list of tasks that are associated with the selected project.

The project codes and sub codes are stored in separate tables.

Example:

User enters project code: 30001 into the first parameter prompt and clicks OK
A second parameter prompt then appears, displaying a list of all sub codes associated with project 30001.


Constraints:
-     As we have 14000 projects, the project cannot be selected from a dropdown list
-     The sub codes are not all unique. They are uniquely linked to a specific project, but some do share the same code (e.g. 30001 – 2222, and 30002 – 2222)

Does that clarify the issue?

Mike
M Wheels
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Feb 2015 at 6:45am
got it, too many records to select from.
this may depedn on your deployment method but I was able to do this in a basic report creation.
 
create a command as your main data source (might work with a stored proc too)
in the command create a parameter matching your project codes field data type (likely numeric) and in the where clause use it in the command  
e.g. WHERE table.projectcode = {?param}
now in the main report create a report param as a dynamic param
point the dynamic param to the subcode field (matching the data type)
in the report select criteria use the report param to filter the existing records that were already filtered via the command param.
e.g. table.subcodes = {?mainreportparam}
 
IN my test when you run or refresh the report you first get promted for the command param, then the prompt refreshed to give you a limited pick list based on your selection
 


Edited by DBlank - 24 Feb 2015 at 6:47am
IP IP Logged
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.047 seconds.