Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: Passing Parameters to stored procedures Post Reply Post New Topic
Author Message
Gimbal
Newbie
Newbie
Avatar

Joined: 06 Jul 2009
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote Gimbal Replybullet Topic: Passing Parameters to stored procedures
    Posted: 06 Jul 2009 at 9:31am
I am using the bundled version of Crystal Reports that comes with VS2008 and linking it to a SQL Server back end with vb.
 
I have the report running correctly (it grabs the stored procedure and runs it) but i have to input the parameter manually each time.
 
Does anyone know of a way around this?
 
I also had a problem with the database logon.....i managed to fix it but now my program tells me there are errors (but there are none in the list) and i have to run the last working version (which is actually the new version). does anyone else think this sounds familiar?
 
I've been struggling with the parameter propblem for a while now and cant find the answers i'm looking for...hence this post.
 
I would appreciate any help you can give me.
 
Thanks
 
Gimbal
IP IP Logged
hill.kenneth.b
Newbie
Newbie


Joined: 06 Jul 2009
Location: United States
Online Status: Offline
Posts: 5
Quote hill.kenneth.b Replybullet Posted: 06 Jul 2009 at 6:02pm

Check to see if the order of your parameters in your SP are the same order as that in your CR rpt file. For example, if your CR rpt file has parameters in the order of:

@FirstName
@LastName
 
then make sure your SP has them in this same order.
 
Also, CR9 allows you to move the order of the parameters with the ALT-up keys by the CR tool in VS2008 does not have this feature.
IP IP Logged
Gimbal
Newbie
Newbie
Avatar

Joined: 06 Jul 2009
Location: United Kingdom
Online Status: Offline
Posts: 2
Quote Gimbal Replybullet Posted: 07 Jul 2009 at 12:32am

Thanks for the reply.

There is only the one parameter (@param1), and it does appear in CR, i just dont know how i can pass the value to it.
 
I have a control on the page that holds the value, how can i then pass it to the report?
 
btw, this is a asp.net application (not sure if that makes a difference)
 
Thanks
IP IP Logged
SDB2
Newbie
Newbie
Avatar

Joined: 08 Apr 2009
Online Status: Offline
Posts: 17
Quote SDB2 Replybullet Posted: 17 Jul 2009 at 8:45am
I solved a similar problem by using a report "shell". What I mean by that is you create a report that just has a detail line and parameters (hidden in a supressed report header) with data types that match the parameters you wish to pass. Then, import your real report as a supreport and use the parameters in the "shell" to link to the subreport. (You don't even have to bring in your stored proceedure into the shell it is strictly that, a shell)
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.012 seconds.