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!

Suppress Prompt

Status
Not open for further replies.

asc1111

Programmer
Apr 26, 2007
2
US
I am developing a report in Crystal Reports XI using a stored procedure from a SQL Server 2005 database. The sp has a parameter. I want to limit the values a user can use for this prompt. I have edited the auto-generated parameter field to specify this list of values.

The problem is: when I run the report, it prompts twice for the parameter. Once with a simple text box and once with a combo box with my list of values. Thankfully, the sp is using the value passed from the combo box and ignoring the value in the text box. But I don't want to be prompted twice. How do I suppress the first prompt?

Thanks.
 
Sounds like you created a NEW SP to me.

A SP cannotpassmultiple values, thisis your databases fault, no Crystal, which is a downside to using SPs, onsiderrewriting it as a view.

The report isprobably calling values basedon the sp parm, then locally (in Crystal) fitlering out basedon the other parm (hence slower and double prompted).

-k
 
Thanks for your reply.

I'm not trying to pass multiple values to a single SP parameter, just get Crystal to provide a list of possible values for the user to select (just one) and pass that to the SP.

I have considered using a view... it won't work. I tried it and I couldn't get it to work. There is some control flow that is needed and views won't handle that.

Crystal is not using the parameter to filter the data because the SP does that before the data is passed to Crystal. The parameter tells the SP what field to filter the data on and the filter fields aren't even returned to Crystal, so Crystal can't be filtering the data based on the parameter supplied.

I know that the first prompt is because Crystal says, "This stored procedure has a parameter in it so I'll prompt the user." The second prompt is because Crystal says, "I have a custom parameter field here so I need to prompt the user." I just want to disable the first prompt since, as I said, the data supplied in the first prompt is completely ignored.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top