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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting Parameter Values 1

Status
Not open for further replies.

turtledisc

Technical User
Oct 28, 2005
8
GB
I'm using Crystal Reports XI to connect to a SQL Server 2000 database.

Table Name: Location
Field Names: PrimaryName, Reportable, Active

I'm trying to create a report that will allow a user to select the PrimaryName from a drop-down list that only shows PrimaryNames where Reportable and Active are equal to 255.

I've tried using cascading parameters and record select criteria but I don't want the users having to select Reportable and Active each time and the PrimaryName is not a static list of values but has new ones added all the time.

Any ideas?

Thanks.

Jacquie Kelly
 
i may be wrong - can you create a view or a query that limits the selection to your criteria and use that view/query to pop the param selection?
 
Use the "Add Command" feature to select the names for a dynamic parameter. Go to the database expert->add command and enter something like:

Select Location.`PrimaryName`
From `Location`Location
Where Location.`Reportable` = 255 and
Location.`Active` = 255

Link this to the Location table on PrimaryName. In the main report, go to insert->parameter->new and check "dynamic" and choose the field {Command.PrimaryName} from the field list to insert. Click on the create parameter column. Then add the following to report->selection formula:

{Location.PrimaryName} = {?PrimaryName}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top