I have build crystal report with vs 2013 and I did the following
- add the database fields for the tables I need.
- I am calling the report from
form1and it display the data
so it is good but what I need to is
get an ID from textbox in the form1 and pass it as parameter to report
so it display a specific record from database fields, so I made a parameter called P_PatientID and pass it to report below is the code I am using on form_load to call the crystal report and pass the parameter P_PatientID
private void F0118_Load(object sender, EventArgs e)
{
string RepPath = Application.StartupPath + @"\REP0100.rpt";
ReportDocument rep = new ReportDocument();
rep.Load(RepPath);
rep.SetParameterValue("P_PatientID", vPatientID);
RepViewer.ReportSource = rep;
rep.Refresh();
}
what I need to know is
- is the parameter should be
staticordynamiclist of values? - do I have to set a default value for it ?
- I do not want to display the prompt that asks for the parameter value on run time
- What I have to do to link that parameter to database fields I display on report so data in report are related to the
IDentered by user inform1textbox?
finally there is no more code to show I post all codes I write for this the reset of things I made throw wizards there is n coding
please help and thanks alot