Print Page | Close Window

Static & Dynamic parameter

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15697
Printed Date: 02 May 2025 at 12:30pm


Topic: Static & Dynamic parameter
Posted By: Rene
Subject: Static & Dynamic parameter
Date Posted: 23 Feb 2012 at 12:24am
I have to use a static parameter for the first selection, after that I want to use a dynamic parameter which has to depend on the static parameter.

Is this possible ? and if how do I proceed?
I'm using Crystal Reports XI
 
Thanks in advance
 
Rene



Replies:
Posted By: lockwelle
Date Posted: 23 Feb 2012 at 4:54am
not quite sure I follow.  You want to display parameters or use them?  If by first and second selection, are you saying that you want to retrieve data, and then based on that data retrieve some more?
 
by static you want from a predefined list of values?
 
if you are talking data selections...CR only selects once
 
if you are talking parameters, I would make use of the cascading parameters, and if you want to pull from a static list to begin with, I would use a command and 'select' the values that you want into a pseudo table using unions like:
 
select x as colName
union
select y
union
select z
 
then you could link your command table to your other tables and have the parameter cascade from them
 
HTH


Posted By: Rene
Date Posted: 23 Feb 2012 at 8:43am
With the first (static) parameter I want users to enter a client number,
with that client number I want to retrieve all policies related to that client.
and displayed on the parameter input screen.

From that list of policies users must select one or more policies.
those policies selected is the selection for the report

Hope this helps to understand what I want to do.


Posted By: lockwelle
Date Posted: 24 Feb 2012 at 4:52am
ok, this fits with the solution mentioned.  Either select all the customers or use the table that they are in, link to the policy table and then the user can cascade through the parameters...selecting a customer will narrow all the policies to be only the policies that belong to the customer, and then the user can select the policies desired.
 
At least that is what I would do.


Posted By: rkrowland
Date Posted: 24 Feb 2012 at 5:51am
This is possible with subreports and 2 SQL commands, I sort of replicated what you wanted (we have clients with multiple matters in their names rather than policies) - what the following does is allow the user to type a client number, once pressing ok, a new parameter field will be displayed which lists all the matters under that client - user selects an option from that list and details of that matter are shown in the sub-report.
 
First create a command for your main report with an embedded static parameter, example to follow;
 
select
matter.number
 
from client
 
join matter
on client.clientindex = matter.client
and client.number = '{?client}'
 
This is simply the list of matters that belong to the client, the result from matter.number will be the options in my second paramter.
 
Now create an additional dynamic parameter (I called mine @Matter) and set the datasource as the result set generated by the above query (matter.number).
 
Now create a command for your subreport (this should contain all the data you actually want to display to the user), this should also have an embedded static parameter to filter the data, my example follows;
 
select
matter.number,
matter.displayname
 
from matter
 
where matter.number = '{?matter}'
 
Now link your subreport static {?matter} parameter to the dynamic {?matter} parameter in your main report.
 
This is what I think you're after, it works fine for me but if I haven't explained the process of implementing it very well let me know.
 
Regards,
Ryan.


Posted By: Rene
Date Posted: 25 Feb 2012 at 7:45pm
Thank you all for your answers, this will get me going again.
Rene



Print Page | Close Window