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

Pass results from selection formula to default values 4 parameter fld

Status
Not open for further replies.

kapaa

Programmer
Nov 3, 2006
28
US
Crystal 10 – SQL 2000

I want to create a parameter field that will display all of our IT Departments so the end user can select the one they want to run the report against, such as IT-Security, IT-Network, etc. about 40 in all. BUT I don’t want this to be a static list where I type in all 40 depts into the default selection list, I was hoping I could do something more dynamic such a formula field that says “ if {group.name startswith ‘IT’ then {group.name}” and then have the parameter field pull from this source.

I’m sure this has been answered in a previous post but I’m not finding it. I see stuff on creating a record selection formula such as ‘if {?group} like ‘IT-Secur*’ then…” but this leaves too much room for error if people don’t type the name correctly. Maybe I’m not using the record selection formula correctly? I just upgraded from 8 to 10 and thought for sure this option would be in 10, perhaps built right into the parameter default value page where you can place in select criteria but NOTHING has changed. Kind of aggravating.
 
You can't create a dynamic parameter, but you could use a command to populate the parameter list. Set up the command like this:

select table.`department`
from table
where table.`department` like 'IT%'

Do not link the command to any other tables in the report, and do not reference {command.department} in the report, except in the parameter screen, where you would select that to populate your value list. If the department names change, you would need to remove the current values and reference the command again. In the main report, set your record selection formula to:

{table.department} = {?dept}

-LB
 
Thanks lbass, confirms that this option doesn't exist at least on v10. What you suggested is kind of what I do now, using another application I hit the database and export to a text file all depts that start with IT. From here, I go into the parameter, click default values, and select my text file to import from. This beats typing out 40 depts for each report, however, if a new group comes on board or an existing has a name change, I have to open just over 100 reports to update each one by re-importing my text file. I've been using Crystal ever since ver-6, can't believe by 10 this isn't an option yet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top