Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<string> Transpoters = new List<string>();
- StringBuilder sb = new StringBuilder();
- foreach (ListItem item in TransporterDropDownList1.Items)
- {
- if (item.Selected)
- Transpoters.Add("'" + item.Value + "'");
- }
- ReportViewer.Reset();
- DateTime fDate = DateTime.Parse(datetimepicker1.Value);
- DataTable dt = GetDate(DateTime.Parse(datetimepicker1.Value), DateTime.Parse(datetimepicker2.Value));
- if (MillDropDownList2.SelectedIndex > -1 && TransporterDropDownList1.SelectedIndex > -1 && Contract_Number.Value.Trim() == "")
- {
- DataView Dv = new DataView(dt);
- Dv.RowFilter = "Mill_Name= '" + MillDropDownList2.SelectedValue + "' AND Transporter_Name IN (" + string.Join(",", Transpoters.ToArray() + ")");
- DataTable filter = new DataTable();
- filter = Dv.ToTable();
- ReportDataSource rds = new ReportDataSource("DataSet1", filter);
- ReportViewer.LocalReport.DataSources.Add(rds);
- ReportViewer.LocalReport.ReportPath = @"RPT/MolassesLifting.rdlc";
- ReportParameter[] rptParams = new ReportParameter[]
- {
- new ReportParameter("FromDate",datetimepicker1.Value),
- new ReportParameter("Todate",datetimepicker2.Value)
- };
- ReportViewer.LocalReport.SetParameters(rptParams);
- ReportViewer.LocalReport.Refresh();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement