Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal 2008 - Additional value to dynamic parameter field

Status
Not open for further replies.

ReportDr00

IS-IT--Management
Mar 2, 2007
194
US
Hello

I have dynamic parameter field that is based of County field (string type) and i would like to add additional value to show in the selection when the report is run. Currently County field has 10 values and i would like to add two additional values so user can select it.
Values in County Field are below
01
02
03
04
05
06
07
08
09
10

Would like below for selection
01
02
03
04
05
06
07
08
09
10
15
99

Really appreciate ideas on how to accomplish this?

Regards
 
Create a command to provide the values for your parameter. A command is just a SQL Select statement. It would look something like this:

Select CompanyNo
from Company
UNION ALL
Select 15
UNION ALL
Select 99
order by 1

Don't link the command to anything in your report, just use it to provide the "list of values" for your dynamic parameter.

-Dell

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year
 
Tweak to command:

Select CompanyNo
from Company
UNION ALL
Select '15'
from Company
UNION ALL
Select '99'
from Company
order by 1

-LB
 
If you're using SQL Server, you don't need the From clause to get the values. If you're in other types of databases, you probably do.

-Dell

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year
 
Hello

I followed both your suggestion and formed the below command, but it is not returning any values. when i remove th UNION ALL it returns the Area values. In my report i have two other tables that is linked one is Site and other is County.

Select Area From Site
UNION ALL
Select '15D' From Site
Order By 1

Any suggestions?

Regards
 
Ok, got it to work. Replaced UNION ALL to UNION and it worked.

Thanks so much for your guidance

Regards
 

Follow up question is how i can map the parameter that was added, to a value in database to be used in record selection formula

for example
we added 15D to the parameter which is not database value, now if user selects it in the parameter how can i map to 15 or any other value in database field to pull the records.
My record selection criteria is
Site.Area=?Site
The value in database for Site.Area field are below
01
02
03
.
.
.
15
Now 15D is selected, i want to set it to 15 so it could return the results for that area.
The parameter field is set to accept multiple values. I appreciate your guidance.

Regards
 
I would edit the selection criteria to something like this:

('15D' in {?site} and Site.Area = 15 or
Site.Area in {?site})

-Dell

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top