public List <object> PrintVendorItemMapping() { try { List <object> llstarg = new List <object>(); List <BindVendorItemMapReport> llstreview = null; BindGrid(); foreach (ListItem lst in drpVendorSearch.Items) { if (lst.Selected && drpVendorSearch.SelectedValue != "All") { SB.Append(lst.Value + ','); } } if (SB.ToString() != "") { listItemMap.ListVendorID = SB.ToString().Substring(0, (SB.Length - 1)); } //var DrpVendorSearch = Array.ConvertAll<string, Int64>(FinalOut.Split(','), Convert.ToInt64); SB.Clear(); foreach (ListItem lst in drpItemCategorySearch.Items) { if (lst.Selected && drpVendorSearch.SelectedValue != "All") { SB.Append(lst.Value + ','); } } if (SB.ToString() != "") { listItemMap.ListItemCategory = SB.ToString().Substring(0, (SB.Length - 1)); } //var DrpItemCategorySearch = Array.ConvertAll<string, Int64>(FinalOut.Split(','), Convert.ToInt64); //list = (from p in service.GetItemMap() where DrpVendorSearch.Contains(inq[0]) select p).ToList(); //list = service.GetItemMap().Where(a => DrpVendorSearch.Contains(a.CategoryID) || a.VendorID == Convert.ToInt64(drpVendorSearch.SelectedValue)).ToList(); SB.Clear(); listItemMap.IsStrActive = rdbstatus.SelectedValue; listItemMap.LoggedIN = defaultPage.UserId; listItemMap.Filter = ""; llstreview = lclsservice.BindVendorItemMapReport(listItemMap).ToList(); //List<GetMedicalSupplyPoReportDetails> llstreview = lclsservice.GetMedicalSupplyPoReportDetails(PRmasterID, null, defaultPage.UserId).ToList(); rvVendorItemMapreport.ProcessingMode = ProcessingMode.Local; rvVendorItemMapreport.LocalReport.ReportPath = Server.MapPath("~/Reports/VendorItemMapSummary.rdlc"); ReportDataSource datasource = new ReportDataSource("VendorItemMapReportDS", llstreview); rvVendorItemMapreport.LocalReport.DataSources.Clear(); rvVendorItemMapreport.LocalReport.DataSources.Add(datasource); rvVendorItemMapreport.LocalReport.Refresh(); Warning[] warnings; string[] streamids; string mimeType; string encoding; string extension; byte[] bytes = null; bytes = rvVendorItemMapreport.LocalReport.Render("PDF", "", out mimeType, out encoding, out extension, out streamids, out warnings); llstarg.Insert(0, bytes); return(llstarg); } catch (Exception ex) { EventLogger log = new EventLogger(config); log.LogException(ex); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", Constant.VendorItemMapErrorMessage.Replace("<<VendorItemMap>>", ex.Message), true); return(null); } }