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

When calling a stored proc from Crystal - how to pass a parameter? 1

Status
Not open for further replies.

Plato2

Programmer
Dec 6, 2002
192
US
I'm using Crystal Reports 8.5 and calling a stored proc using ODBC connection. I need to pass a parameter to the stored proc. It prompts for parameter for a user to select but I don't want it to prompt for parameter to select. I want assign a default value to the parameter field. The parameter will be calculated based on formula.

How can I pass this parameter to a stored proc?

Thanks in advance
 
Why have a parameter in a Stored Procedure if you don't want one to be passed? You can build it into the SP to determine if null was sent and then use your default.

The code to do so would be based on the type of database, and since you didn't bother to share that, I'll assume that you can handle that side.

-k
 
To expand on what k stated, even if you set the parameter to NULL by default, you'll still get prompted for it when the report is run.

-dave
 
Ok Let me explain the situation more clearly. I’m using a subreport in my report. Subreport uses a stored procedure that needs a parameter to be sent. This parameter will be passed from my “main” report to subreport. Then I don’t know how to pass this parameter to my stored procedure.

How can I pass this parameter to a stored procedure?

 
Right click on the subreport > Change subreport links > pick the field you want to link to the stored proc from the 'Avalable Fields' list, and put it in the 'Fields to link to' list box > click the 'Subreport parameter field to use' drop down, and use the tiny little scroll bars on the drop down to select your stored proc parameter.

-dave
 
Thank you for the reply.

I couldn't complete the last stage you are explaining.

"and use the <b>tiny little scroll bars on the drop down</b> to select your stored proc parameter."

I could'nt find my stored proc parameter to use....
Can you explain in more details how to do that?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top