Kato Martin

Kato Martin

  • NA
  • 5
  • 6.6k

crystalreport multiple parameters

Sep 11 2012 11:11 AM
Hi everyone,
Hope your all alright. I am trying to generate a crystal report in my c sharp project. I have been able to generate a report with one parameter using the code below
{
crystalReportViewer1.Visible = true;
ReportDocument cryRpt = newReportDocument();
cryRpt.Load("C:/Users/katoto/Documents/Visual Studio 2010/Projects/Genesis Philcollins/Genesis Philcollins/CrystalReport1.rpt");

ParameterFieldDefinitions crParameterFieldDefinitions;
  ParameterFieldDefinition crParameterFieldDefinition;
  ParameterValues crParameterValues = new ParameterValues();
  ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();

crParameterDiscreteValue.Value = comboBox2.Text;
  crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
  crParameterFieldDefinition = crParameterFieldDefinitions["status"];
  crParameterValues = crParameterFieldDefinition.CurrentValues;



crParameterValues.Clear();
   crParameterValues.Add(crParameterDiscreteValue);
  crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);

  crystalReportViewer1.ReportSource = cryRpt;
  crystalReportViewer1.Refresh();

}
Well my problem now is that I am trying to generate a crystal report with multiple parameters, for example I would like to generate a report "WHERE STATUS LIKE COMBOBOX1.TEXT AND PRESENCE LIKE COMBOBOX2.TEXT"
How can I achieve a report of this kind. Any help will be greatly appreciated.
Kind Regards.Kato