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

report question - parameters

Status
Not open for further replies.

ncchish

Programmer
Jul 29, 2002
86
US
I'm using CR11. Currently, I have 2 reports that bring back the same data. The reports are on the intranet and the user enters either ssn or agent number (parameters) to retrieve the report. I'm trying to combine the reports into one report where they enter either ssn or agent number on one report, but it's not working. Do you think this should work?

Thanks for any advice.
 
Sure. What I think you're asking is how to make the parameters optional. you need to do something like this:

(isnull(?SSN Param}) or {table.ssn} = {?SSN Param})
and
(isnull(?Agent Param}) or {table.agent = {?Agent Param})...
 
You should be able to set this up, as long as the record selection is handled right.

Create two parameters: prmSwitch and prmFilter. prmSwitch is a string parameter that lets you make a choice from the value list: "SSN" or "Agent Number". Set this for no custom value. Set prmFilter as a string parameter with a custom value. This is where your user enters their SSN or Agent number.

In the record selection, use the following formula:

if {?prmSwitch} = "SSN" then
({SSN field} = {?prmFilter})
else if {?prmSwitch} = "Agent Number" then
{Agent number field} = {?prmFilter}

enclose this in parentheses if you have more record selection variables. Let me know how this works out!

 
Thanks guys! DBAJSmith, I used your suggestion. It worked the first time I tried it. Thanks to you both!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top