byte[] Download_Rpt_Requir_info(int Inst_ID) { using (UOSEntities db = new UOSEntities()) { Microsoft.Reporting.WebForms.LocalReport rpt = new Microsoft.Reporting.WebForms.LocalReport(); rpt.ReportPath = Server.MapPath(@"~/Aff_Reports/Aff_ins_Recuring_INFO.rdlc"); rpt.DataSources.Add(new ReportDataSource("AJ_Rep_Recuring_INFO", db.AJ_Rep_Recuring_INFO(Convert.ToInt32(Inst_ID)))); return(rpt.Render("PDF")); } }
public ActionResult AffRptViewer(string Rept) { ReportViewer reportViewer = new ReportViewer(); reportViewer.ProcessingMode = ProcessingMode.Local; reportViewer.SizeToReportContent = true; if (Rept == "A") { var DBvlu = db.AJ_Aff_Ins_Apply_Rep_Declaration(Convert.ToInt32( AffiliationAdminDetail.Inst_Id_for_Admin)); reportViewer.LocalReport.ReportPath = Server.MapPath(@"~/Aff_Reports/Aff_Ins_Apply_Rep_Declaration.rdlc"); ; reportViewer.LocalReport.DataSources.Add(new ReportDataSource("AJ_Aff_Ins_Apply_Rep_Declaration", DBvlu)); } else if (Rept == "F1") { var DBvlu = db.AJ_POP_Bulding_INFO(Convert.ToInt32(AffiliationAdminDetail.Inst_Id_for_Admin)); reportViewer.LocalReport.ReportPath = Server.MapPath(@"~/Aff_Reports/Aff_Inst_BuldingDetails.rdlc"); reportViewer.LocalReport.DataSources.Add(new ReportDataSource("AJ_POP_Bulding_INFO", DBvlu)); } else if (Rept == "F2") { var DBvlu = db.AJ_Rep_Non_Recuring_INFO(Convert.ToInt32(AffiliationAdminDetail.Inst_Id_for_Admin)); reportViewer.LocalReport.ReportPath = Server.MapPath(@"~/Aff_Reports/Aff_ins_Non_Recuring_INFO.rdlc"); reportViewer.LocalReport.DataSources.Add(new ReportDataSource("AJ_Rep_Non_Recuring_INFO", DBvlu)); } else if (Rept == "F3") { var DBvlu = db.AJ_Rep_Recuring_INFO(Convert.ToInt32(AffiliationAdminDetail.Inst_Id_for_Admin)); reportViewer.LocalReport.ReportPath = Server.MapPath(@"~/Aff_Reports/Aff_ins_Recuring_INFO.rdlc"); reportViewer.LocalReport.DataSources.Add(new ReportDataSource("AJ_Rep_Recuring_INFO", DBvlu)); } else if (Rept == "F4") { var DBvlu = db.AJ_Rep_SportFacilities_INFO(Convert.ToInt32(AffiliationAdminDetail.Inst_Id_for_Admin)); reportViewer.LocalReport.ReportPath = Server.MapPath(@"~/Aff_Reports/Aff_Inst_SportFculty.rdlc"); reportViewer.LocalReport.DataSources.Add(new ReportDataSource("AJ_Rep_SportFacilities_INFO", DBvlu)); } else if (Rept == "F5") { var DBvlu = db.AJ_Rep_Employee_INFO(Convert.ToInt32(AffiliationAdminDetail.Inst_Id_for_Admin), 0); reportViewer.LocalReport.ReportPath = Server.MapPath(@"~/Aff_Reports/Aff_Inst_Staff_Info.rdlc"); reportViewer.LocalReport.DataSources.Add(new ReportDataSource("AJ_Rep_Employee_INFO", DBvlu)); } else if (Rept == "F6") { var DBvlu = db.AJ_Rep_Employee_INFO(Convert.ToInt32(AffiliationAdminDetail.Inst_Id_for_Admin), 1); reportViewer.LocalReport.ReportPath = Server.MapPath(@"~/Aff_Reports/Aff_Inst_Staff_Info.rdlc"); reportViewer.LocalReport.DataSources.Add(new ReportDataSource("AJ_Rep_Employee_INFO", DBvlu)); } else if (Rept == "F7") { var DBvlu1 = db.AJ_Rep_Library_INFO(Convert.ToInt32(AffiliationAdminDetail.Inst_Id_for_Admin)); var DBvlu2 = db.AJ_Affi_ins_Rep_OtherFacilities_INFO(Convert.ToInt32(Models.obj.Institute_Id)); reportViewer.LocalReport.ReportPath = Server.MapPath(@"~/Aff_Reports/Aff_Inst_Library_INFO.rdlc"); reportViewer.LocalReport.DataSources.Add(new ReportDataSource("AJ_Rep_Library_INFO", DBvlu1)); reportViewer.LocalReport.DataSources.Add(new ReportDataSource("Affi_ins_Rep_OtherFacilities_INFO", DBvlu2)); } else if (Rept == "F8") { var DBvlu = db.AJ_Rep_Laboratory_INFO(Convert.ToInt32(AffiliationAdminDetail.Inst_Id_for_Admin)); reportViewer.LocalReport.ReportPath = Server.MapPath(@"~/Aff_Reports/Aff_inst_AJ_Rep_Laboratory_INFO.rdlc"); reportViewer.LocalReport.DataSources.Add(new ReportDataSource("AJ_Rep_Laboratory_INFO", DBvlu)); } else if (Rept == "BLC") { var DBvlu = db.Aff_Ins_Rpt_Balance_Rec(); reportViewer.LocalReport.ReportPath = Server.MapPath(@"~/Aff_Reports/Aff_Ins_Rpt_Balance_Rec.rdlc"); reportViewer.LocalReport.DataSources.Add(new ReportDataSource("Aff_Ins_Rpt_Balance_Rec", DBvlu)); } ViewBag.ReportViewer = reportViewer; return View(); }