Hello All,
I have a report which works fine and it is set to my report viewer. I have the SQL select statement hard coded. I have a dropdown box on the same page and I want to append that user name to the select statement. I am a bit confounded on how to change the select statement. Here is the code and I want to dynamically hand in the user id (which is 4 in my hard coded case). I know how to get the selected item out of the dropdown...it just isn't clear how I get the web page to hand it into the report. Any thoughts?
Thank you.
William
I have a report which works fine and it is set to my report viewer. I have the SQL select statement hard coded. I have a dropdown box on the same page and I want to append that user name to the select statement. I am a bit confounded on how to change the select statement. Here is the code and I want to dynamically hand in the user id (which is 4 in my hard coded case). I know how to get the selected item out of the dropdown...it just isn't clear how I get the web page to hand it into the report. Any thoughts?
Thank you.
William
public ReportClass()
{
StringBuilder sb = new StringBuilder();
InitializeComponent();
sb.Append("select SY.name_system, SE.id_employee, SE.id_system, SE.id_user, SE.date_change").Append(" ");
sb.Append("from Secured SE").Append(" ");
sb.Append("inner join Systems SY on SY.id_system=SE.id_system").Append(" ");
sb.Append("where SE.is_active=1 and SE.id_employee=").Append("4").Append(" ");
sb.Append("Order by SE.date_change DESC");
sqlSource.SelectCommand = sb.ToString();
txtRunDate.Value = DateTime.Today.ToShortDateString();
}