Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. List<string> Transpoters = new List<string>();
  2. StringBuilder sb = new StringBuilder();
  3. foreach (ListItem item in TransporterDropDownList1.Items)
  4. {
  5. if (item.Selected)
  6.  
  7. Transpoters.Add("'" + item.Value + "'");
  8. }
  9.  
  10. ReportViewer.Reset();
  11. DateTime fDate = DateTime.Parse(datetimepicker1.Value);
  12. DataTable dt = GetDate(DateTime.Parse(datetimepicker1.Value), DateTime.Parse(datetimepicker2.Value));
  13. if (MillDropDownList2.SelectedIndex > -1 && TransporterDropDownList1.SelectedIndex > -1 && Contract_Number.Value.Trim() == "")
  14. {
  15. DataView Dv = new DataView(dt);
  16. Dv.RowFilter = "Mill_Name= '" + MillDropDownList2.SelectedValue + "' AND Transporter_Name IN (" + string.Join(",", Transpoters.ToArray() + ")");
  17. DataTable filter = new DataTable();
  18. filter = Dv.ToTable();
  19. ReportDataSource rds = new ReportDataSource("DataSet1", filter);
  20. ReportViewer.LocalReport.DataSources.Add(rds);
  21. ReportViewer.LocalReport.ReportPath = @"RPT/MolassesLifting.rdlc";
  22. ReportParameter[] rptParams = new ReportParameter[]
  23. {
  24. new ReportParameter("FromDate",datetimepicker1.Value),
  25. new ReportParameter("Todate",datetimepicker2.Value)
  26. };
  27. ReportViewer.LocalReport.SetParameters(rptParams);
  28. ReportViewer.LocalReport.Refresh();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement