When trying to pass the string from C # Windows Forms to Crystal Report following the procedure of the second image and the code below the crystal report shows the following error! Visual Studio Community 2017, Mysql free and Crystal Report Sap.
Error:
Code:
privatevoidForm2_Load(objectsender,EventArgse){ReportDocumentcryRpt=newReportDocument();cryRpt.Load("C:\Users\Rafael\Desktop\ProG\Gold Business - Another\Gold Business\CrystalReport1.rpt");
ParameterFieldDefinitions crParameterFieldDefinitions;
ParameterFieldDefinition crParameterFieldDefinition;
ParameterValues crParameterValues = new ParameterValues();
ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();
crParameterDiscreteValue.Value = usuario;
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
crParameterFieldDefinition = crParameterFieldDefinitions["usuario"];
crParameterValues = crParameterFieldDefinition.CurrentValues;
crParameterValues.Clear();
crParameterValues.Add(crParameterDiscreteValue);
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
crystalReportViewer1.ReportSource = cryRpt;
crystalReportViewer1.Refresh();
}