Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Dynamic Value List for Parameter Values Post Reply Post New Topic
Author Message
sengle
Newbie
Newbie
Avatar

Joined: 18 Jul 2008
Location: Afghanistan
Online Status: Offline
Posts: 5
Quote sengle Replybullet Topic: Dynamic Value List for Parameter Values
    Posted: 21 Jul 2008 at 2:44pm
SmileThis is new to me so need help.  I usually use a static 'List of Values' for my reports.  This time, I am needing to use a dynamic 'List of Values'  but I need to also have an option that will select 'ALL' if the use doesn't select a value from the list.  I know how to do it using a static 'List of Values' by adding the option to the pick list of "ALL" and then test that in the code if they selected the 'ALL.
Anyone know how to do it with the dynamic 'List of Values'?  I can't add the 'ALL' to the list since it is coming from a database table.
 
Thanks so much in advance!
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 22 Jul 2008 at 3:55am

Hi,

In you report create a separate command object and with the code below
 
Select  '...ALL' as fieldname
from TableName
union
Select fieldname     
from TableName
 
When selecting the parameter dynamic field select the one from command object
 
 
Cheers
Rahul
IP IP Logged
sengle
Newbie
Newbie
Avatar

Joined: 18 Jul 2008
Location: Afghanistan
Online Status: Offline
Posts: 5
Quote sengle Replybullet Posted: 23 Jul 2008 at 1:09pm
Rahul,

Thanks for the information.  Really helped but something is not working.

I created a new command object using this code.

select '...ALL' as NAME_LAST_FIRST_MIDDLE
from sbs_reports_reg_style_v
UNION
select Name_Last_First_Middle
from sbs_reports_reg_style_v

 

I then created a new parameter field called ‘Person’, dynamic and used the new command object that had the one field “NAME_LAST_MIDDLE” listed to select to populate the dropdown.

 

In the select expert I added this code:

{Command.NAME_LAST_FIRST_MIDDLE} = {?Person}

 

When I run the report, the selection box comes up with the proper list of names and the choice of ‘…ALL’. This is great.

 

But when I select a person, the report starts reading the data and never selects a record. I have to stop the report as it keeps going and going.

 

Before I changed the parameter to use the command object and only use the table field it worked.

 

What am I missing?

IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 23 Jul 2008 at 1:37pm

Hi,

In record selection formula

use the code below

if {?Person} = '...ALL' then
true
else
{COMMAND.NAME_LAST_FIRST_MIDDLE} = {?Person}

 
Let me know ....
 
cheers
Rahul
IP IP Logged
sengle
Newbie
Newbie
Avatar

Joined: 18 Jul 2008
Location: Afghanistan
Online Status: Offline
Posts: 5
Quote sengle Replybullet Posted: 23 Jul 2008 at 2:02pm

Rahul,

I have already tried that but tried to simplify it even more with out the if/else.

I copied and pasted your code and it doesn't work either.  I am not choosing the '...ALL' as I am trying to select a person from the list just to see if I can get that working first.  The '...ALL' does the same thing - just going through the records but not selecting anything at which point I have to stop the report.

 
Thanks,
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 24 Jul 2008 at 1:44am
Hi,
 
Try comparing your {table.fieldname} with the {?person} parameter in the else part and  {?person} = '...ALL' in the if part.
 
How many records you have ,also post some sample data so that I can check ...
 
cheers
rahul


Edited by rahulwalawalkar - 24 Jul 2008 at 1:45am
IP IP Logged
sengle
Newbie
Newbie
Avatar

Joined: 18 Jul 2008
Location: Afghanistan
Online Status: Offline
Posts: 5
Quote sengle Replybullet Posted: 24 Jul 2008 at 2:55pm
Rahul,
I emailed you at rahulwalawalkar@yahoo.com hoping that you still have this email.  I wanted to give you screen shots which this forum doesn't support.
Let me know if this email address is no longer good.
Thanks,
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 25 Jul 2008 at 2:11am
Replied to your email ..... hope the solution works....
 
cheers
Rahul
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.