Link to home
Start Free TrialLog in
Avatar of cUnSharp
cUnSharp

asked on

Using Stored Procedure, How do I set parameter in Crystal Reports .NET "Missing Parameter Values"

Hello all,

I've spent at least a day pulling my hair out on this one.  I've searched many a forum for a solution.  This issue seems fairly straight forward but I it seems that I'm missing something.  I created a SPROC in SQL Server 2005 that expects a param of type string.  I created a simple crystal report in VS 2008 (I tried using both a DataSet and OLE DB connection to the SPROC) and used the following code to set the param.  I've tried various ways to implement this to no avail.  By setting the 'EnablePrompt' property on the report viewer, I can type in a value and data is returned.  Please provide some insight!  

ReportDocument rd = new ReportDocument();
rd.load(Server.MapPath("some path");
CrystalReportViewer1.ReportSource = rd;
ParameterFields pFS = CrystalReportViewer1.ParameterFieldInfo;
ParameterValues pVs = new ParameterValues();
ParameterDiscreateValue = pDV = new ParameterDiscreateValue();
pDV.Value = "someStringValue";
pVs.Add(pDV);
ParameterField pF = pFS["@someParam"];
pF.CurrentValues = pVs;
CrystalReportViewer1.DataBind();



ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial