I have a form that gets a value form the user. I call the report form (the winform with the report viewer) and pass it the value the user supplied. I thought I could pass this to the report but I can't see to figure it out.
In the report class, I have:
Obviously, I want to pass that value to the report class, but I'm baffled as to where I should do it. I have a reportviewer in a winform and the report source is the above report class.
How do I do this?
In the report class, I have:
public rptTimeSheet(string sheetID)
{
string comStr = "SELECT * FROM vwTimeSheetReport WHERE TimeSheetID = " + sheetID;
SqlConnection sqlConnection1 = new SqlConnection();
SqlCommand sqlSelectCommand1 = new SqlCommand();
SqlDataAdapter sqlDataAdapter1 = new SqlDataAdapter();
sqlConnection1.ConnectionString = "XXXX";
sqlSelectCommand1.CommandText = comStr;
sqlSelectCommand1.Connection = sqlConnection1;
sqlDataAdapter1.SelectCommand = sqlSelectCommand1;
this.DataSource = sqlDataAdapter1;
InitializeComponent();
}
Obviously, I want to pass that value to the report class, but I'm baffled as to where I should do it. I have a reportviewer in a winform and the report source is the above report class.
How do I do this?