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!

Passing report value to Stored Procedure parameter.

Status
Not open for further replies.

Zarobi

Technical User
Feb 19, 2004
13
US
Crystal Reports 9.0.

I am writing a month end summary report for accounts with activity during the month of February. My database is SQL ODBC. The base report includes an account ID with the account's physical information (address, contact, phone, etc). The month end summary figures have been calculated for me by our IT staff in a SQL Stored Procedure.

I need to pass each of the account IDs in my report to the Stored Procedure for it to produce the numbers for my report. I thought I might be able to store the ID as a shared variable and pass that to a sub-report with the stored procedure. My problem is, I don't know how to tell Crystal to use my variable for the stored procedure's parameter.

Or I could be going about this all wrong.
 
I would look at moving the SQL that your report is generating into a Stored Procedure. You could then call the SP that your IT staff created and join the recordsets there. This could allow for one recordset to be returned that would include all your data, and eliminate the need fo that subreport.

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top