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("so me path");
CrystalReportViewer1.Repor tSource = rd;
ParameterFields pFS = CrystalReportViewer1.Param eterFieldI nfo;
ParameterValues pVs = new ParameterValues();
ParameterDiscreateValue = pDV = new ParameterDiscreateValue();
pDV.Value = "someStringValue";
pVs.Add(pDV);
ParameterField pF = pFS["@someParam"];
pF.CurrentValues = pVs;
CrystalReportViewer1.DataB ind();
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("so
CrystalReportViewer1.Repor
ParameterFields pFS = CrystalReportViewer1.Param
ParameterValues pVs = new ParameterValues();
ParameterDiscreateValue = pDV = new ParameterDiscreateValue();
pDV.Value = "someStringValue";
pVs.Add(pDV);
ParameterField pF = pFS["@someParam"];
pF.CurrentValues = pVs;
CrystalReportViewer1.DataB
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.