title: How to solve "The types of the parameter field and parameter field current values are not compatible" in Crystal parameter
body: <p>I'm getting the above error when passing parameter to Crystal Reports in VS 2008</p>
  
  <p>This is how I do it:</p>
  
  <pre><code>reportPath = GetReportPath(ReportType);
  CRReport.Load(reportPath);
  CrystalReportViewer1.ReportSource = CRReport;
  AddParameterToReport("DocumentID", DocumentID);
  
  ConnectionInfo connectionInfo = ConnInfo();
  SetDBLogonForReport(connectionInfo, CRReport);
  SetDataSetForMultipleSubReport(connectionInfo, CRReport);
  </code></pre>
  
  <p><code>AddParameter()</code>:</p>
  
  <pre><code>ParameterFields parameterFields = CrystalReportViewer1.ParameterFieldInfo;
  ParameterValues currentParameterValues = new ParameterValues();
  ParameterDiscreteValue parameterDiscreteValue = new ParameterDiscreteValue();
  
  parameterDiscreteValue.Value = CRParamValue;
  currentParameterValues.Add(parameterDiscreteValue);
  
  ParameterField parameterField = parameterFields[CRParamName];
  parameterField.CurrentValues = currentParameterValues;
  </code></pre>
  
  <p>And <code>ApplyingCurrentValues()</code>:</p>
  
  <pre><code>ParameterFields crParameterFields = CRReport.ParameterFields;
  ParameterField crParameterField = new ParameterField();
  
  try
  {
      // loop through all the sections to find all the report objects 
      foreach (ParameterField crParameterField1 in crParameterFields)
      {
          for (int i = 0; i &lt; CRReport.ParameterFields.Count; i++)
          {
              ParameterValues CrParaVals = new ParameterValues();
              DataDefinition CrDataDef = CRReport.DataDefinition;
              ParameterFieldDefinitions PFDefs = CrDataDef.ParameterFields;
              crParameterFields = CrystalReportViewer1.ParameterFieldInfo;
              crParameterField = crParameterFields[i];
              CrParaVals = crParameterField.CurrentValues;
  
              CRReport.DataDefinition.ParameterFields[i].ApplyCurrentValues(CrParaVals);
          }
      }
  }
  catch (Exception ex)
  {
      ex = null;
  }
  </code></pre>
  
  <p>Getting the above error in the highlighted line.</p>
  
  <p>Can anyone please help me to solve this?</p>
  
  <p>I have only on parameter field in my Crystal Report as shown below.</p>
  
  <p><img src="https://i.stack.imgur.com/AVPoK.png" alt=""></p>