×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

passing stored proc parameters

passing stored proc parameters

passing stored proc parameters

(OP)
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 =)

RE: passing stored proc parameters

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("CRCol") = Session("oRpt").Parameterfields

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

set CRCustParam2 = session("CRCol").item(2)
Call CRCustParam2.SetCurrentValue (CStr("Pioline"), 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("oRpt").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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close