Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to pass two parameters namely: Doctor Name and Date of Order to a crystal report by using windows form control such as a comboBox and two datetimePicker controls for date range. Is it possible, please help me. When the user will run the crystal report, first he will select Doctor Name(comboBox) and two dates(datetimePicker1 and datetimePicker2).
Posted

form1 c = new form1 ();
c.crystalReportViewer1.ShowCloseButton = true;
c.MdiParent = this.MdiParent;
crystalreport1 id = new crystalreport1 ();


id.RecordSelectionFormula = "{DrTable.Drname}='" + cmbboc.text + "' where Datetimepicker1>=#" + dtfrom.Text + "# and Datetimepicker2<=#" + dtto.Text + "# )

c.crystalReportViewer1.ReportSource = id;
//id.crystalReportViewer1.Refresh();
c.Show();
 
Share this answer
 
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900