Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: pass input parameter to the proc used Post Reply Post New Topic
Author Message
venij
Newbie
Newbie


Joined: 03 Dec 2009
Online Status: Offline
Posts: 5
Quote venij Replybullet Topic: pass input parameter to the proc used
     Posted: 03 Dec 2009 at 4:49pm
Hi,
 
I call a stored proc in the crystal subreport using the add command. Crystal has an input parameter of type string, I need to pass this parameter to the stored proc to filter the data.
 
Can somebody suggest how to implement this, I am not sure of the syntax,  does this need any extra coding?
 
This is required asap.
 
 
Thanks.
IP IP Logged
savethepennies
Newbie
Newbie
Avatar

Joined: 14 Oct 2009
Online Status: Offline
Posts: 14
Quote savethepennies Replybullet Posted: 04 Dec 2009 at 3:40pm
I tend to set my stored procedure as a data source. Crystal then creates parameter fields for the parameters required by the stored procedure. I can then let Crystal prompt for the values automatically or create my own parameters and pass the values to the subreport.
 
During some recent searching I did come across some posts on this. If I remember correctly you pass the values to the stored procedure like this:
exec stored_procedure @stored_procedure_parameter='{?selectedvalue}'
Hopefully that puts you on the right track at least. Like I said I really haven't used stored procedures that way so I'm just taking a stab at it.
IP IP Logged
SteveR
Newbie
Newbie


Joined: 19 Mar 2010
Online Status: Offline
Posts: 1
Quote SteveR Replybullet Posted: 19 Mar 2010 at 5:41am

Did this work for you?  I tried it and get a syntax error.  Does selectedvalue represent a variable name  like a formula field or a static literal value?  I need to assign the value to the parameter in my Stored Procedure at the time of execution from a formula field or better yet another parameter field that was selected from a drop down list. Any examples of how to do this?

IP IP Logged
Yudi
Newbie
Newbie


Joined: 03 Aug 2009
Online Status: Offline
Posts: 13
Quote Yudi Replybullet Posted: 21 Mar 2010 at 3:39pm

Hi SteveR

you could find it in the simple article i've wrote in my blog. Just open the following link :
Thanks And Regards
Yudi Purwanto
http://yudio.net/
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum