Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Static & Dynamic parameter Post Reply Post New Topic
Author Message
Rene
Newbie
Newbie


Joined: 23 Feb 2012
Location: Netherlands
Online Status: Offline
Posts: 4
Quote Rene Replybullet Topic: Static & Dynamic parameter
    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
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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
IP IP Logged
Rene
Newbie
Newbie


Joined: 23 Feb 2012
Location: Netherlands
Online Status: Offline
Posts: 4
Quote Rene Replybullet 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.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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.
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet 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.


Edited by rkrowland - 24 Feb 2012 at 5:52am
IP IP Logged
Rene
Newbie
Newbie


Joined: 23 Feb 2012
Location: Netherlands
Online Status: Offline
Posts: 4
Quote Rene Replybullet Posted: 25 Feb 2012 at 7:45pm
Thank you all for your answers, this will get me going again.
Rene
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.016 seconds.