Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Report Parameter Names Help Post Reply Post New Topic
Author Message
hdjim69
Newbie
Newbie


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 24
Quote hdjim69 Replybullet Topic: Report Parameter Names Help
     Posted: 02 Feb 2009 at 12:46pm
Hello, I'm using the CR that comes with VS2005.  I'm trying to use a stored proc as the data source for a report.  The SP has parameters.  I know I must match the paramter names the report uses to the parameter names in code.  But I can't find where in the report I need to look to find the exact names of the parameters.  Any help is appreciated.
 
hd
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Feb 2009 at 1:32pm
Hey HD,
trying to get a handle on your question.
Do you have run time parameters in your SP and you also want to put those parameters as runtime options in your crystal?
If this is the case isn't this a redundant process? Why not build your SP with no parameters (or hard code it to do some filtering if possible) and then let crystal handle the select paramters.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Feb 2009 at 6:12am
When I have built reports that bind directly to a stored proc, crystal automatically builds the parameters (which are named exactly the same as in the stored proc) and they are under the parameter section of the report. 
I haven't used the built in version, and I no longer bind directly to the stored proc, so I may be a bit rusty on this.
IP IP Logged
hdjim69
Newbie
Newbie


Joined: 29 Dec 2008
Location: United States
Online Status: Offline
Posts: 24
Quote hdjim69 Replybullet Posted: 03 Feb 2009 at 8:12am

Hi, thanks all for responding.  I kept getting the error message "the parameter is incorrect".  Here is the details.  I’m working in VS2005.  I have a stored proc that accepts one parameter.  I created a schema (dataset file) and dragged and dropped the stored proc on the schema designer.  I then went into the report and selected ADO.net as the data source and via the ellipse buttons, navigated to the schema file to use as the data source for the report.  In the Field Explorer I can see the stored proc.  I mistakenly thought I needed to assign the parameter to the SP thru code by using CrystalDecisions.Shared.ParameterDiscreteValue and CrystalDecisions.Shared.ParameterField, etc. which I did but keep getting the "the parameter is incorrect" error message.  I tried using both types of values for the parameter, that is, with the @ sign prefix for the parameter and without but keep getting the same error.  I then noticed in the Field Explorer that no parameter was showing so I removed all the CrystalDecisions.Shared.ParameterDiscreteValue & CrystalDecisions.Shared.ParameterField code and just created the dataset via C# code and assigned the dataset as the reports data source and it ran fine. 

 

Therefore, I concluded that if you don’t see any paramters in the Field Explorer, you don’t need to assign them using CrystalDecisions.Shared code. 

IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Feb 2009 at 1:29pm
sounds good.  Since you are assigning the dataset, the report doesn't need to know the parameters.  It only needs the parameters if it is retrieving/filtering the data.  You are supplying the data, it doesn't care about the parameters...unless you want to print them on the report.
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