protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //ReportViewer viewer = new ReportViewer(); string searchText = string.Empty; if (Request.QueryString["searchText"] != null) { searchText = Request.QueryString["searchText"].ToString(); } List <EMPLOYEE> employee = null; using (var _context = new PfaDbContext1()) { employee = _context.EMPLOYEES.Where(t => t.PIN.Contains(searchText)).OrderBy(a => a.PIN).ToList(); WLReportViewer.LocalReport.ReportPath = Server.MapPath("http://fpmlwebsvr.fidelitypensionmanagers.com/thehub/branch_portal/reports/wl_new_format.rdlc"); WLReportViewer.LocalReport.DataSources.Clear(); ReportDataSource rdc = new ReportDataSource("new_wlDataSet", employee); WLReportViewer.LocalReport.DataSources.Add(rdc); ReportParameter[] rp = new ReportParameter[2]; rp[0] = new ReportParameter("report_pin", ""); rp[1] = new ReportParameter("pwdparam", ""); WLReportViewer.LocalReport.SetParameters(rp); WLReportViewer.LocalReport.Refresh(); WLReportViewer.DataBind(); } } }
public static List <SelectListItem> GetEmployers(object value = null) { PfaDbContext1 db = new PfaDbContext1(); var classlists = (from cs in db.EMPLOYER_DETAILS select cs).Take(1000); List <SelectListItem> items = new List <SelectListItem>(); // items.Add(new SelectListItem { Text = "- Select Country -", Value = "" }); foreach (var ts in classlists) { items.Add(new SelectListItem { Text = ts.NAME.ToString(), Value = (ts.NAME).ToString() }); } return(items); }