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!

How to pass parameters to stored procedure from ASP

Status
Not open for further replies.

bhaskar1

Programmer
Jun 18, 2002
1
0
0
US
I am trying to pass parameters from my ASP page to crystal reports. Crystal Reports opens and prompts the user to enter the values. I want the ASP page to pass the parametetrs to crystal reports which should execute a stored procedure based on those parameters without prompting the user to enter the values when crystal report opens.



I tried with methods:

1)querySQL = " & querySQL

2)querySQL = "SPCFTVReport_New.rpt?rf=1&user0=&password0=&wid=" & varWID & "&CFID=" & varCFID & "&IOval=" & varIOVal

3)
In either case i have same answer, that is promting the user to enter the values.

How do I do this?
 
I guess what you want to do is pass Parameters from your ASP page to your Crystal report which is using a stored procedure.
1)First, in your report create parameters for whatever fields you require.
2)Then in the report itself, if you want to make any selection based on these parameters, on the menu Report-->Edit Selection Formul-->Record specify your criteria.
If all u want to do is pass these parameters to your stored proc then this step is not needed.
3)In the ASP page decalare the parameters collection
EX:
Set ParamFieldsCollection = objReport.ParameterFields
Set Parameter = ParamFieldsCollection.Item(1)
Call Parameter.SetCurrentValue(CStr(your value),Parameter.ValueType)
do this for all your parameters.

Hope this works.
Thx,
Seema
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top