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

passing stored proc parameters

Status
Not open for further replies.

jermine

Programmer
Jun 15, 2001
59
SG
Hi!
I need help on solving the problem with the crystal report. I have five paramaters created using SQL stored procedures i can have any of the parameters that i have
(something like a criteria). If i pass a parameter with a "" value then it is read as null.

Whenever i run the stored procedure in the query analyzer,
i only specify the parameters or criteria i want and i have no problem with it.

BUT when i run it in the web server an error occurs.
NOTE: The crystal report is called by an asp.
I have to fill up all the values for the parameters.

Can any one help me how to solve this problem.
Thanks in advance =)

 
Hi Jermine,

You fill and pass ParameterFields collection to the report.

After setting the calling OpenReport and setting the options, you need to decide which of your reports need to be fed with ParameterFields collection? You can take this decision in Select Case construct based on name of the report. Obviously you will have to hardcode this thing.

You need to do something like this:
<<<<<
set session(&quot;CRCol&quot;) = Session(&quot;oRpt&quot;).Parameterfields

set CRCustParam = session(&quot;CRCol&quot;).item(1)
Call CRCustParam.SetCurrentValue (CStr(&quot;Cedric&quot;), 12)

set CRCustParam2 = session(&quot;CRCol&quot;).item(2)
Call CRCustParam2.SetCurrentValue (CStr(&quot;Pioline&quot;), 12)

Like this all the parameters you have to pass in the sequence expected by the report.
>>>>>

For reports that do not need parameterfields, it is just smooth sailing. You do not need to do anything like the code above. But suppose your report needs dynamic query kind of thing, and then you need to build the query dynamically and set it as following.

<<<<<
session(&quot;oRpt&quot;).SQLQueryString = cstr(strSt)

Here strSt is the query you will build in your page according to the query string parameters.
>>>>>

Get back if I misunderstood your question.

Have Fun,
Malay M. Thakershi
mthakershi@yahoo.co.in
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top