on ‎2011 Mar 11 3:01 AM
In database i choose stored procedure, parameter field automatically created and then i remove @ in parameter field,
i used three method searched in asp .net, all failed. Error is missing parameter values.
I have also tried to add back @ also failed
Method 1
// First parameter
ParameterFieldDefinitions crParameterFieldDefinitions;
ParameterFieldDefinition crParameterFieldDefinition;
ParameterValues crParameterValues = new ParameterValues();
ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();
crParameterDiscreteValue.Value = Request.QueryString["Cheque_IssueRecord_Secretary_Review_TT_ID"].ToString();
crParameterFieldDefinitions = objRpt.DataDefinition.ParameterFields;
crParameterFieldDefinition = crParameterFieldDefinitions["Cheque_IssueRecord_Secretary_Review_TT_ID"];
crParameterValues = crParameterFieldDefinition.CurrentValues;
crParameterValues.Clear();
crParameterValues.Add(crParameterDiscreteValue);
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
// Second parameter
ParameterFieldDefinitions crParameterFieldDefinitions2;
ParameterFieldDefinition crParameterFieldDefinition2;
ParameterValues crParameterValues2 = new ParameterValues();
ParameterDiscreteValue crParameterDiscreteValue2 = new ParameterDiscreteValue();
crParameterDiscreteValue2.Value = Request.QueryString["tCOMDB"].ToString();
crParameterFieldDefinitions2 = objRpt.DataDefinition.ParameterFields;
crParameterFieldDefinition2 = crParameterFieldDefinitions2["tCOMDB"];
crParameterValues2 = crParameterFieldDefinition2.CurrentValues;
crParameterValues2.Clear();
crParameterValues2.Add(crParameterDiscreteValue2);
crParameterFieldDefinition2.ApplyCurrentValues(crParameterValues2);Method 2
var value = new ParameterDiscreteValue();
value.Value = Convert.ToInt32(Request.QueryString["Cheque_IssueRecord_Secretary_Review_TT_ID"]);
objRpt.ParameterFields["Cheque_IssueRecord_Secretary_Review_TT_ID"].CurrentValues.Add(value);
var value2 = new ParameterDiscreteValue();
value2.Value = Request.QueryString["tCOMDB"];
objRpt.ParameterFields["tCOMDB"].CurrentValues.Add(value2);
Method 3
CrystalReportViewer1.ReportSource = objRpt;
foreach (ParameterField p in CrystalReportViewer1.ParameterFieldInfo)
{
//if (Request.QueryString[p.Name])
//{
var value = Request.QueryString[p.ToString()];
if (p.CurrentValues.Count > 0)
((ParameterDiscreteValue)p.CurrentValues[0]).Value = value;
else
p.CurrentValues.Add(new ParameterDiscreteValue() { Value = value });
//}
}
Methdod4
/
/objRpt.SetParameterValue(0, Convert.ToInt32(Request.QueryString["Cheque_IssueRecord_Secretary_Review_TT_ID"]));
//objRpt.SetParameterValue(1, Request.QueryString["tCOMDB"]);
Request clarification before answering.
See if the samples csharp_win_multirangeparam.zip, csharp_win_paramengine.zip, csharp_win_rangeparameters.zip will help.
You do not mention version of CR or version of .NET - both would be minimal pieces of info, but do make sure you are on the latest SP for your version of CR and that the version of CR is supported in your version of .NET...
- Ludek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.