/// <summary> /// Frontend Page: Report Page(Curtailment Invoice Report) /// Title: Display Curtailment Invoice details report /// Designed: Kanishka SHM /// User story: /// Developed: Kanishka SHM /// Date created: /// </summary> public void RenderReport(int loanId, DateTime startDate, DateTime endDate, List <CurtailmentShedule> curtailments) { //check authentication session is null, if null return if (Session["AuthenticatedUser"] == null) { return; } User userData = (User)Session["AuthenticatedUser"]; //set report viewr property dynamically rptViewerCurtailmentInvoice.ProcessingMode = ProcessingMode.Local; rptViewerCurtailmentInvoice.Reset(); rptViewerCurtailmentInvoice.LocalReport.EnableExternalImages = true; rptViewerCurtailmentInvoice.LocalReport.ReportPath = Server.MapPath("~/Reports/RptCurtailmentInvoice.rdlc"); rptViewerCurtailmentInvoice.ZoomMode = ZoomMode.PageWidth; //get report header details ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.TopHeaderDetails(loanId, userData.UserId); //add dates, date range and current date foreach (var dates in details) { dates.StartRange = startDate.ToString("MM/dd/yyyy"); dates.EndRange = endDate.ToString("MM/dd/yyyy"); dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } //set data source to report viwer rptViewerCurtailmentInvoice.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); rptViewerCurtailmentInvoice.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", curtailments)); }
/// <summary> /// Frontend Page: Step 10(Loan Terms Report) /// Title: Display Loan Terms Report print page /// Designed: Kanishka SHM /// User story: /// Developed: Kanishka SHM /// Date created: /// </summary> public ReportViewer PrintPage(int loanId) { //check authentication session is null, if null return if (Session["AuthenticatedUser"] == null) { return(null); } User userData = (User)Session["AuthenticatedUser"]; //create reportviwer & set reportviewr properties ReportViewer rptViewerLoanTermsPrint = new ReportViewer(); rptViewerLoanTermsPrint.ProcessingMode = ProcessingMode.Local; rptViewerLoanTermsPrint.Reset(); rptViewerLoanTermsPrint.LocalReport.EnableExternalImages = true; rptViewerLoanTermsPrint.LocalReport.ReportPath = Server.MapPath("~/Reports/RptLoanTerms.rdlc"); rptViewerLoanTermsPrint.ZoomMode = ZoomMode.PageWidth; ReportAccess ra = new ReportAccess(); //Get loan details and set to reportviwer List <RptLoanTerms> loanTermsDetails = ra.RptLoanTermsDetails(loanId); rptViewerLoanTermsPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", loanTermsDetails)); List <LoanDetailsRpt> details = ra.GetLoanDetailsRptforCompanySummary(userData.Company_Id, userData.UserId); rptViewerLoanTermsPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet6", details)); //get curtailment schedule details and set to reportviwer CurtailmentAccess ca = new CurtailmentAccess(); List <Curtailment> curtailments = ca.retreiveCurtailmentByLoanId(loanId); if (curtailments != null && curtailments.Count > 0) { for (int i = 0; i < curtailments.Count; i++) { curtailments[i].CurtailmentId = i + 1; } } rptViewerLoanTermsPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", curtailments)); //get fees details and set to reportviwer List <RptFeeLoanTerm> loanTermsFeeDetails = ra.RptLoanTermsFeeDetails(loanId); rptViewerLoanTermsPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet3", loanTermsFeeDetails)); //get reminders details and set to reportviwer List <RptEmailReminder> loanTermsEmailReminders = ra.RptLoanTermsEmailReminders(loanId); rptViewerLoanTermsPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet4", loanTermsEmailReminders)); //get unit types and set to reportviwer IList <Models.UnitType> unitTypes = ra.RptGetUnitTypes(loanId); rptViewerLoanTermsPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet5", unitTypes)); //return reportviwer return(rptViewerLoanTermsPrint); }
/* * * Frontend page: Report Page(Lot Inspection Report) * Title: Display Lot Inspection Report * Designed: Kanishka SHM * User story: * Developed: Kanishka SHM * Date created: * */ protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int loanId = 0; //get loan id from query string if (Request.QueryString["loanId"] != "") { loanId = Convert.ToInt32(Request.QueryString["loanId"]); } ReportAccess ra = new ReportAccess(); //get all active units List <ReportUnitModels> units = ra.GetAllActiveUnitDetailsRpt(loanId); //if result count is greater then zero show report, otherwise give a message if (units.Count > 0) { //call RenderReport function to show report on report viwer RenderReport(loanId, units); Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowFrame", "ShowDive();", true); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "HideFrame", "HideDive();", true); } } }
/// <summary> /// Frontend Page: Report(lot inspection fee receipt) /// Title:load details of paid lot inspection fee /// Deigned:Piyumi Perera /// User story: /// Developed:Piyumi Perera /// Date created: /// </summary> /// <param name="loanId"></param> /// <param name="startDate"></param> /// <param name="endDate"></param> /// <param name="lotInspectionFee"></param> public void RenderReport(int loanId, DateTime startDate, DateTime endDate, List <RptFee> lotInspectionFee) { //check authentication session is null, if null return if (Session["AuthenticatedUser"] == null) { return; } User userData = (User)Session["AuthenticatedUser"]; rptViewerLotInspectionFeeReceipt.ProcessingMode = ProcessingMode.Local; rptViewerLotInspectionFeeReceipt.Reset(); rptViewerLotInspectionFeeReceipt.LocalReport.EnableExternalImages = true; rptViewerLotInspectionFeeReceipt.LocalReport.ReportPath = Server.MapPath("~/Reports/RptLotInspectionFeeReceipt.rdlc"); rptViewerLotInspectionFeeReceipt.ZoomMode = ZoomMode.PageWidth; ReportAccess ra = new ReportAccess(); //get loan details of selected loan List <LoanDetailsRpt> details = ra.GetLoanDetailsRpt(loanId, userData.UserId); foreach (var dates in details) { //assign date fields values dates.StartRange = startDate.ToString("MM/dd/yyyy"); dates.EndRange = endDate.ToString("MM/dd/yyyy"); dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } //add data sources rptViewerLotInspectionFeeReceipt.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); rptViewerLotInspectionFeeReceipt.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", lotInspectionFee)); }
/* * * Frontend page: Report Page * Title: Load details to report and show on browser * Designed: Kanishka SHM * User story: * Developed: Kanishka SHM * Date created: * */ protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int loanId = 0; int titleStatus = 0; if (Request.QueryString["loanId"] != "") { loanId = Convert.ToInt32(Request.QueryString["loanId"]); } if (!string.IsNullOrEmpty(Request.QueryString["titleStatus"])) { titleStatus = Convert.ToInt32(Request.QueryString["titleStatus"]); } ReportAccess ra = new ReportAccess(); //Get unit details by given title status List <Unit> units = ra.GeUnitDetailsByTitleStatus(loanId, titleStatus); if (units.Count > 0) { RenderReport(loanId, titleStatus, units); Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowFrame", "ShowDive();", true); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "HideFrame", "HideDive();", true); } } }
/// <summary> /// Frontend Page: Add Unit(Add Unit Report) /// Title: Display Advance Units /// Designed: Kanishka SHM /// User story: /// Developed: Kanishka SHM /// Date created: /// </summary> public void RenderReport(int loanId) { //Check authentication session is null then return if (Session["AuthenticatedUser"] == null) { return; } User userData = (User)Session["AuthenticatedUser"]; rptViewerAddUnit.ProcessingMode = ProcessingMode.Local; rptViewerAddUnit.Reset(); rptViewerAddUnit.LocalReport.EnableExternalImages = true; rptViewerAddUnit.LocalReport.ReportPath = Server.MapPath("~/Reports/RptAddUnit.rdlc"); rptViewerAddUnit.ZoomMode = ZoomMode.PageWidth; //Get account details ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.TopHeaderDetails(loanId, userData.UserId); foreach (var dates in details) { dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } //Set data set to report rptViewerAddUnit.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); //Get just added units details List <RptAddUnit> units = ra.GetJustAddedUnitDetails(userData.UserId, loanId); //Set data set to report rptViewerAddUnit.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", units)); }
public ReportViewer PrintPage(int loanId, string idNumber) { //Check authentication session is null then return if (Session["AuthenticatedUser"] == null) { return(null); } User userData = (User)Session["AuthenticatedUser"]; ReportViewer rptViewerIndividualCurtailmentSummaryPrint = new ReportViewer(); rptViewerIndividualCurtailmentSummaryPrint.ProcessingMode = ProcessingMode.Local; rptViewerIndividualCurtailmentSummaryPrint.Reset(); rptViewerIndividualCurtailmentSummaryPrint.LocalReport.EnableExternalImages = true; rptViewerIndividualCurtailmentSummaryPrint.LocalReport.ReportPath = Server.MapPath("~/Reports/RptIndividualCurtailmentSummary.rdlc"); rptViewerIndividualCurtailmentSummaryPrint.ZoomMode = ZoomMode.PageWidth; ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.TopHeaderDetails(loanId, userData.UserId); foreach (var dates in details) { dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } rptViewerIndividualCurtailmentSummaryPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); //Get all curtailment summary details List <RptIndividualCurtailmentSummary> indiCurtailment = ra.GetIndividualCurtailmentSummarRptDetails(loanId, idNumber); rptViewerIndividualCurtailmentSummaryPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", indiCurtailment)); return(rptViewerIndividualCurtailmentSummaryPrint); }
/* * * Frontend page: Report Page * Title: Load details to report and show on browser * Designed: Kanishka SHM * User story: * Developed: Kanishka SHM * Date created: * */ public void RenderReport(int loanId, int titleStatus, List <Unit> units) { //check authentication session is null, if null return if (Session["AuthenticatedUser"] == null) { return; } User userData = (User)Session["AuthenticatedUser"]; //set report viewr property dynamically rptViewerTitleStatus.ProcessingMode = ProcessingMode.Local; rptViewerTitleStatus.Reset(); rptViewerTitleStatus.LocalReport.EnableExternalImages = true; rptViewerTitleStatus.LocalReport.ReportPath = Server.MapPath("~/Reports/RptTitleStatus.rdlc"); rptViewerTitleStatus.ZoomMode = ZoomMode.PageWidth; //get report header details ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.TopHeaderDetails(loanId, userData.UserId); foreach (var dates in details) { dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } //set data source to report viwer rptViewerTitleStatus.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); rptViewerTitleStatus.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", units)); }
/// <summary> /// Frontend Page: Report page(Individual curtailment summary report) /// Title: Display Individual curtailment summary report /// Designed: Piyumi Perera /// User story: DFP 488 /// Developed: Piyumi Perera /// Date created: 7/5/2016 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int loanId = 0; string idNumber = ""; //if session is not null and assign it. if (Request.QueryString["loanId"] != "") { loanId = Convert.ToInt32(Request.QueryString["loanId"]); } if (Request.QueryString["idNumber"] != "" && Request.QueryString["idNumber"] != null) { idNumber = Request.QueryString["idNumber"]; } ReportAccess ra = new ReportAccess(); //Get all curtailment summary details List <RptIndividualCurtailmentSummary> indiCurtailment = ra.GetIndividualCurtailmentSummarRptDetails(loanId, idNumber); if (indiCurtailment.Count > 0) { //call RenderReport function to show report on report viwer RenderReport(loanId, idNumber, indiCurtailment); Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowFrame", "ShowDive();", true); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "HideFrame", "HideDive();", true); } } }
/// <summary> /// Frontend Page: Report page(Individual curtailment summary report) /// Title: Display Individual curtailment summary report /// Designed: Piyumi Perera /// User story: DFP 488 /// Developed: Piyumi Perera /// Date created: 7/5/2016 /// </summary> /// <param name="loanId"></param> public void RenderReport(int loanId, string idNumbe, List <RptIndividualCurtailmentSummary> indiCurtailment) { //Check authentication session is null then return if (Session["AuthenticatedUser"] == null) { return; } User userData = (User)Session["AuthenticatedUser"]; //Dynamicaly set report viwer propertiece rptViewerIndividualCurtailmentSummary.ProcessingMode = ProcessingMode.Local; rptViewerIndividualCurtailmentSummary.Reset(); rptViewerIndividualCurtailmentSummary.LocalReport.EnableExternalImages = true; rptViewerIndividualCurtailmentSummary.LocalReport.ReportPath = Server.MapPath("~/Reports/RptIndividualCurtailmentSummary.rdlc"); rptViewerIndividualCurtailmentSummary.ZoomMode = ZoomMode.PageWidth; //Get details of loan ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.TopHeaderDetails(loanId, userData.UserId); foreach (var dates in details) { dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } //Set data set to report rptViewerIndividualCurtailmentSummary.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); //Set data set to report rptViewerIndividualCurtailmentSummary.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", indiCurtailment)); }
/// <summary> /// Frontend Page: Report Page(Loan Summary Report) /// Title: Display Loan Summary Report /// Designed: Kasun Samarawickrama /// User story: /// Developed: Kasun Samarawickrama /// Date created: /// </summary> public void RenderReport(int loanId, DateTime startDate, DateTime endDate, List <RptLoanSummary> loanSummaryList) { //check authentication session is null, if null return if (Session["AuthenticatedUser"] == null) { return; } User userData = (User)Session["AuthenticatedUser"]; //set report viewr property dynamically rptViewerLoanSummary.ProcessingMode = ProcessingMode.Local; rptViewerLoanSummary.Reset(); rptViewerLoanSummary.LocalReport.EnableExternalImages = true; rptViewerLoanSummary.LocalReport.ReportPath = Server.MapPath("~/Reports/RptLoanSummary.rdlc"); rptViewerLoanSummary.ZoomMode = ZoomMode.PageWidth; //Get account details ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.GetLoanDetailsRpt(loanId, userData.UserId); foreach (var dates in details) { dates.StartRange = startDate.ToString("MM/dd/yyyy"); dates.EndRange = endDate.ToString("MM/dd/yyyy"); dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } //set data source to report viwer rptViewerLoanSummary.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); rptViewerLoanSummary.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", loanSummaryList)); }
/// <summary> /// Frontend Page: Report Page(Company Summary Report) /// Title: Display Company Summary details print page /// Designed: Kanishka SHM /// User story: /// Developed: Kanishka SHM /// Date created: /// </summary> public ReportViewer PrintPage(int companyId) { //check authentication session is null, if null return if (Session["AuthenticatedUser"] == null) { return(null); } User userData = (User)Session["AuthenticatedUser"]; //set report viewr property dynamically ReportViewer rptViewerCompanySummaryPrint = new ReportViewer(); rptViewerCompanySummaryPrint.ProcessingMode = ProcessingMode.Local; rptViewerCompanySummaryPrint.Reset(); rptViewerCompanySummaryPrint.LocalReport.EnableExternalImages = true; rptViewerCompanySummaryPrint.LocalReport.ReportPath = Server.MapPath("~/Reports/RptCompanySummary.rdlc"); rptViewerCompanySummaryPrint.ZoomMode = ZoomMode.PageWidth; //get report header details ReportAccess ra = new ReportAccess(); List <RptCompanySummary> loanSumaList = ra.RptGetCompanySummary(companyId); //set data source to report viwer - 1 rptViewerCompanySummaryPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", loanSumaList)); List <LoanDetailsRpt> details = ra.GetLoanDetailsRptforCompanySummary(userData.Company_Id, userData.UserId); //set data source to report viwer - 2 rptViewerCompanySummaryPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", details)); //return report viwer return(rptViewerCompanySummaryPrint); }
/// <summary> /// Frontend Page: Report Page(Advance Unit Report) /// Title: Display Advance Units /// Designed: Kanishka SHM /// User story: /// Developed: Kanishka SHM /// Date created: /// </summary> public void RenderReport(int loanId, DateTime startDate, DateTime endDate, List <ReportFullInventoryUnit> units) { //Check authentication session is null then return if (Session["AuthenticatedUser"] == null) { return; } User userData = (User)Session["AuthenticatedUser"]; //set reportviewr properties rptViewerAdvanceUnitRpt.ProcessingMode = ProcessingMode.Local; rptViewerAdvanceUnitRpt.Reset(); rptViewerAdvanceUnitRpt.LocalReport.EnableExternalImages = true; rptViewerAdvanceUnitRpt.LocalReport.ReportPath = Server.MapPath("~/Reports/RptAdvanceReport.rdlc"); rptViewerAdvanceUnitRpt.ZoomMode = ZoomMode.PageWidth; //Get account details ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.TopHeaderDetails(loanId, userData.UserId); foreach (var dates in details) { dates.StartRange = startDate.ToString("MM/dd/yyyy"); dates.EndRange = endDate.ToString("MM/dd/yyyy"); dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } //Set data set to report rptViewerAdvanceUnitRpt.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); rptViewerAdvanceUnitRpt.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", units)); }
/// <summary> // Frontend Page: Report page(Branch Summary report) /// Title: Display Branch Summary report /// Designed: Piyumi Perera /// User story: /// Developed: Piyumi Perera /// Date created: /// </summary> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int branchId = 0; string branchName = ""; //if session is not null and assign it. if (Request.QueryString["branchId"] != "") { branchId = Convert.ToInt32(Request.QueryString["branchId"]); } if (Request.QueryString["branchName"] != "") { branchName = Request.QueryString["branchName"]; } //Get branch summary details ReportAccess ra = new ReportAccess(); List <RptBranchSummary> branchSummary = ra.GetBranchSummarRptDetails(branchId); //if result count is greater then zero show report, otherwise give a message if (branchSummary.Count > 0) { //call RenderReport function to show report on report viwer RenderReport(branchId, branchName, branchSummary); Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowFrame", "ShowDive();", true); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "HideFrame", "HideDive();", true); } } }
/// <summary> /// Frontend Page: Advance Unit Page(Advance Unit Report) /// Title: Display Advance Units during session /// Designed: Kanishka SHM /// User story: /// Developed: Kanishka SHM /// Date created: /// </summary> public ReportViewer PrintPage(int loanId) { //Check authentication session is null then return if (Session["AuthenticatedUser"] == null) { return(null); } User userData = (User)Session["AuthenticatedUser"]; //create reportviwer & set reportviewr properties ReportViewer rptViewerAdvanceUnitPrint = new ReportViewer(); rptViewerAdvanceUnitPrint.ProcessingMode = ProcessingMode.Local; rptViewerAdvanceUnitPrint.Reset(); rptViewerAdvanceUnitPrint.LocalReport.EnableExternalImages = true; rptViewerAdvanceUnitPrint.LocalReport.ReportPath = Server.MapPath("~/Reports/RptAdvanceUnit.rdlc"); List <Unit> units = (List <Unit>)Session["AdvItems"]; //Get account details ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.TopHeaderDetails(loanId, userData.UserId); foreach (var dates in details) { dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } //Set data set to report rptViewerAdvanceUnitPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); //if unit count is not null and count is greater than 0, create xml string if (units != null && units.Count > 0) { try { //create xml string XElement xEle = new XElement("Units", from unit in units select new XElement("Unit", new XElement("UnitId", unit.UnitId) )); string xmlDoc = xEle.ToString(); //get all advance unit during session var advanceUnits = ra.AdvanceUnitsDuringSession(xmlDoc); //Set data set to report rptViewerAdvanceUnitPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", advanceUnits)); } catch (Exception e) { throw e; } } //return reportviwer return(rptViewerAdvanceUnitPrint); }
public ActionResult DeleteReport(int reportID) { ReportAccess access = new ReportAccess(); bool isSucceed; string message = access.DeleteReport(reportID, out isSucceed); return(Reports(ReportType.Type.Article, message, isSucceed)); }
public ActionResult Report(int articleID, ReportModel.reportType reportType) { ReportAccess access = new ReportAccess(); ViewData["ReportMessage"] = access.ReportArticle(articleID, reportType); return(View("ReportMessage")); }
/// <summary> /// Frontend Page: Pay Curtailment Page(Curtailment Receipt Report) /// Title: Display Curtailment Receipt report during session /// Designed: Kanishka SHM /// User story: /// Developed: Kanishka SHM /// Date created: /// </summary> public void RenderReport(int loanId) { //Check authentication session is null then return if (Session["AuthenticatedUser"] == null) { return; } User userData = (User)Session["AuthenticatedUser"]; //set reportviewr properties rptViewerCurtailmentReceiptDuringSession.ProcessingMode = ProcessingMode.Local; rptViewerCurtailmentReceiptDuringSession.Reset(); rptViewerCurtailmentReceiptDuringSession.LocalReport.EnableExternalImages = true; rptViewerCurtailmentReceiptDuringSession.LocalReport.ReportPath = Server.MapPath("~/Reports/RptCurtailmentDuringSession.rdlc"); rptViewerCurtailmentReceiptDuringSession.ZoomMode = ZoomMode.PageWidth; //Get account details ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.TopHeaderDetails(loanId, userData.UserId); foreach (var dates in details) { dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } //Set data set to report rptViewerCurtailmentReceiptDuringSession.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); //get unit list from session List <CurtailmentShedule> selectedCurtailmentSchedules = (List <CurtailmentShedule>)Session["CurtUnitDuringSession"]; //assign unit ids List <string> uniList = (from item in selectedCurtailmentSchedules select item.UnitId).Distinct().ToList(); //create xml string XElement xEle = new XElement("Curtailments", from id in uniList select new XElement("Unit", new XElement("UnitId", id) )); string xmlDoc = xEle.ToString(); //get unit curatilment details during session List <CurtailmentShedule> unitWithAdvanceAmount = ra.GetCurtailmentPaidDetailsDuringSession(xmlDoc); foreach (var item in selectedCurtailmentSchedules) { item.PurchasePrice = unitWithAdvanceAmount.First(x => x.UnitId == item.UnitId).PurchasePrice; } if (selectedCurtailmentSchedules != null && selectedCurtailmentSchedules.Count > 0) { //Set data set to report rptViewerCurtailmentReceiptDuringSession.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", selectedCurtailmentSchedules)); } }
public ActionResult Report(int articleID, ReportModel.reportType reportType) { ReportAccess access = new ReportAccess(); //ViewData["ReportMessage"] = access.ReportArticle(articleID, reportType); bool isSucceed; return(Read(articleID, access.ReportArticle(articleID, reportType, out isSucceed), isSucceed)); //return View("ReportMessage"); }
//[HttpPost] public FileResult PrintPage() { if (Session["curtLaonId"] == null || Session["curtLaonId"].ToString() == "") { return(null); } Warning[] warnings; string[] streamids; string mimeType; string encoding; string filenameExtension; ReportViewer rptViewerPrint = new ReportViewer(); int loanId = (int)Session["curtLaonId"]; //RptDivCUrtailmentReceiptDuringSession curtThisSession = new RptDivCUrtailmentReceiptDuringSession(); //return curtThisSession.PrintPage(loanId); ReportViewer rptViewerCurtailmentReceiptDuringSessionPrint = new ReportViewer(); rptViewerCurtailmentReceiptDuringSessionPrint.ProcessingMode = ProcessingMode.Local; rptViewerCurtailmentReceiptDuringSessionPrint.Reset(); rptViewerCurtailmentReceiptDuringSessionPrint.LocalReport.EnableExternalImages = true; rptViewerCurtailmentReceiptDuringSessionPrint.LocalReport.ReportPath = Server.MapPath("~/Reports/RptCurtailmentDuringSession.rdlc"); ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.TopHeaderDetails(loanId, userData.UserId); foreach (var dates in details) { dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } rptViewerCurtailmentReceiptDuringSessionPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); List <CurtailmentShedule> selectedCurtailmentSchedules = (List <CurtailmentShedule>)Session["CurtUnitDuringSession"]; if (selectedCurtailmentSchedules != null && selectedCurtailmentSchedules.Count > 0) { rptViewerCurtailmentReceiptDuringSessionPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", selectedCurtailmentSchedules)); } var bytes = rptViewerCurtailmentReceiptDuringSessionPrint.LocalReport.Render( "PDF", null, out mimeType, out encoding, out filenameExtension, out streamids, out warnings); var fsResult = File(bytes, "application/pdf"); return(fsResult); }
/// <summary> // Frontend Page: Report page(Branch Summary report) /// Title: Display Branch Summary report /// Designed: Piyumi Perera /// User story: /// Developed: Piyumi Perera /// Date created: /// </summary> public void RenderReport(int branchId, string branchName, List <RptBranchSummary> branchSummary) { //check authentication session is null, if null return if (Session["AuthenticatedUser"] == null) { return; } User userData = (User)Session["AuthenticatedUser"]; //set reportviewr properties rptViewerBranchSummary.ProcessingMode = ProcessingMode.Local; rptViewerBranchSummary.Reset(); rptViewerBranchSummary.LocalReport.EnableExternalImages = true; rptViewerBranchSummary.LocalReport.ReportPath = Server.MapPath("~/Reports/RptBranchSummary.rdlc"); rptViewerBranchSummary.ZoomMode = ZoomMode.PageWidth; ReportAccess ra = new ReportAccess(); User usr = new User(); usr = (new UserAccess()).retreiveUserByUserId(userData.UserId); List <LoanDetailsRpt> details = new List <LoanDetailsRpt>(); LoanDetailsRpt detail = new LoanDetailsRpt(); detail.CompanyName = userData.CompanyName; if (userData.RoleId == 1) { detail.LenderBrnchName = branchName; } else { detail.LenderBrnchName = userData.BranchName; } detail.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); detail.CreaterName = usr.FirstName + " " + usr.LastName; details.Add(detail); rptViewerBranchSummary.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", details)); foreach (var dates in details) { dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } rptViewerBranchSummary.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", branchSummary)); }
/* * * Frontend page: Report Page * Title: Lot Inspection Report print page * Designed: Kanishka SHM * User story: * Developed: Kanishka SHM * Date created: * */ public ReportViewer PrintPage(int loanId) { //check authentication session is null, if null return if (Session["AuthenticatedUser"] == null) { return(null); } User userData = (User)Session["AuthenticatedUser"]; //set report viewr property dynamically ReportViewer rptViewerLotInspectionPrint = new ReportViewer(); rptViewerLotInspectionPrint.ProcessingMode = ProcessingMode.Local; rptViewerLotInspectionPrint.Reset(); rptViewerLotInspectionPrint.LocalReport.EnableExternalImages = true; rptViewerLotInspectionPrint.LocalReport.ReportPath = Server.MapPath("~/Reports/RptLotInspection.rdlc"); //get report header details ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.TopHeaderDetails(loanId, userData.UserId); //add current date foreach (var dates in details) { dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } //set data source to report viwer - 1 rptViewerLotInspectionPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); //get all active units List <ReportUnitModels> units = ra.GetAllActiveUnitDetailsRpt(loanId); foreach (var unit in units) { unit.View = false; } //set data source to report viwer - 2 rptViewerLotInspectionPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", units)); //return report viwer return(rptViewerLotInspectionPrint); }
/// <summary> /// Frontend Page: Report page(Advance Fee invoice Report) /// Title: Display Advance Fee invoice /// Designed: Kasun Samarawickrama /// User story: /// Developed: Kasun Samarawickrama /// Date created: /// </summary> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int loanId = 0; string feeType = "advanceFee"; //Report type //if session is not null and assign it. if (Request.QueryString["loanId"] != "") { loanId = Convert.ToInt32(Request.QueryString["loanId"]); } if (string.IsNullOrEmpty(Request.QueryString["startDate"])) { return; } var startDate = DateTime.ParseExact(Request.QueryString["startDate"], "MM/dd/yyyy", CultureInfo.InvariantCulture); if (string.IsNullOrEmpty(Request.QueryString["endDate"])) { return; } var endDate = DateTime.ParseExact(Request.QueryString["endDate"], "MM/dd/yyyy", CultureInfo.InvariantCulture); //Get Advance Fee invoice details during time period ReportAccess ra = new ReportAccess(); List <RptFee> advanceFeeInvoice = ra.GetFeeInvoiceByDateRange(loanId, feeType, startDate, endDate); //if result count is greater then zero show report, otherwise give a message if (advanceFeeInvoice.Count > 0) { //call RenderReport function to show report on report viwer RenderReport(loanId, startDate, endDate, feeType, advanceFeeInvoice); Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowFrame", "ShowDive();", true); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "HideFrame", "HideDive();", true); } } }
/// <summary> /// Frontend Page: Report(lot inspection fee invoice) /// Title:load details of lot inspection fee invoice /// Deigned:Piyumi Perera /// User story: /// Developed:Piyumi Perera /// Date created: /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int loanId = 0; //assign fee type string feeType = "lotInspectionFee"; //check selected loan id is not empty and assign to variable if (Request.QueryString["loanId"] != "") { loanId = Convert.ToInt32(Request.QueryString["loanId"]); } //check selected start date is not empty and assign to variable if (string.IsNullOrEmpty(Request.QueryString["startDate"])) { return; } var startDate = DateTime.ParseExact(Request.QueryString["startDate"], "MM/dd/yyyy", CultureInfo.InvariantCulture); //check selected end date is not empty and assign to variable if (string.IsNullOrEmpty(Request.QueryString["endDate"])) { return; } var endDate = DateTime.ParseExact(Request.QueryString["endDate"], "MM/dd/yyyy", CultureInfo.InvariantCulture); ReportAccess ra = new ReportAccess(); //get all lot inspection details which match with the given date range List <RptFee> lotInspectionFeeInvoice = ra.GetFeeInvoiceByDateRange(loanId, feeType, startDate, endDate); //check list count is>0 if (lotInspectionFeeInvoice.Count > 0) { //load report RenderReport(loanId, startDate, endDate, feeType, lotInspectionFeeInvoice); Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowFrame", "ShowDive();", true); } else { //show no data found message Page.ClientScript.RegisterStartupScript(this.GetType(), "HideFrame", "HideDive();", true); } } }
/// <summary> /// Frontend Page: Report Page(Curtailment Receipt Report) /// Title: Display Curtailment Receipt report /// Designed: Kanishka SHM /// User story: /// Developed: Kanishka SHM /// Date created: /// </summary> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int loanId = 0; //if session is not null and assign it. if (Request.QueryString["loanId"] != "") { loanId = Convert.ToInt32(Request.QueryString["loanId"]); } if (string.IsNullOrEmpty(Request.QueryString["startDate"])) { return; } var startDate = DateTime.ParseExact(Request.QueryString["startDate"], "MM/dd/yyyy", new CultureInfo("en-US")); if (string.IsNullOrEmpty(Request.QueryString["endDate"])) { return; } var endDate = DateTime.ParseExact(Request.QueryString["endDate"], "MM/dd/yyyy", new CultureInfo("en-US")); //Get all active units curtailment paid details during time period ReportAccess ra = new ReportAccess(); List <CurtailmentShedule> curtailments = ra.GetCurtailmentPaidDetailsByDateRange(loanId, startDate, endDate); //if result count is greater then zero show report, otherwise give a message if (curtailments.Count > 0) { //call RenderReport function to show report on report viwer RenderReport(loanId, startDate, endDate, curtailments); Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowFrame", "ShowDive();", true); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "HideFrame", "HideDive();", true); } } }
/* * * Frontend page : Report page * Title : Display Delete units report * Designed : Kanishka SHM * User story : * Developed : Kanishka SHM * Date created : 06/23/2016 * */ protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int loanId = 0; //if session is not null and assign it. if (Request.QueryString["loanId"] != "") { loanId = Convert.ToInt32(Request.QueryString["loanId"]); } if (string.IsNullOrEmpty(Request.QueryString["startDate"])) { return; } var startDate = DateTime.ParseExact(Request.QueryString["startDate"], "MM/dd/yyyy", CultureInfo.InvariantCulture); if (string.IsNullOrEmpty(Request.QueryString["endDate"])) { return; } var endDate = DateTime.ParseExact(Request.QueryString["endDate"], "MM/dd/yyyy", CultureInfo.InvariantCulture); ReportAccess ra = new ReportAccess(); //Get all delete units details List <RptDeletedUnit> deletedUnits = ra.RptGetDeletedUnitByLoanIdDateRange(loanId, startDate, endDate); //if result count is greater then zero show report, otherwise give a message if (deletedUnits.Count > 0) { //call RenderReport function to show report on report viwer RenderReport(loanId, startDate, endDate, deletedUnits); Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowFrame", "ShowDive();", true); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "HideFrame", "HideDive();", true); } } }
/// <summary> /// Frontend Page: Pay Curtailment Page(Curtailment Receipt Report) /// Title: Display Curtailment Receipt print page /// Designed: Kanishka SHM /// User story: /// Developed: Kanishka SHM /// Date created: /// </summary> public ReportViewer PrintPage(int loanId) { //Check authentication session is null then return if (Session["AuthenticatedUser"] == null) { return(null); } User userData = (User)Session["AuthenticatedUser"]; //create reportviwer & set reportviewr properties ReportViewer rptViewerCurtailmentReceiptDuringSessionPrint = new ReportViewer(); rptViewerCurtailmentReceiptDuringSessionPrint.ProcessingMode = ProcessingMode.Local; rptViewerCurtailmentReceiptDuringSessionPrint.Reset(); rptViewerCurtailmentReceiptDuringSessionPrint.LocalReport.EnableExternalImages = true; rptViewerCurtailmentReceiptDuringSessionPrint.LocalReport.ReportPath = Server.MapPath("~/Reports/RptCurtailmentDuringSession.rdlc"); //Get account details ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.TopHeaderDetails(loanId, userData.UserId); foreach (var dates in details) { dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } //Set data set to report rptViewerCurtailmentReceiptDuringSessionPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); //get unit curatilment details during session List <CurtailmentShedule> selectedCurtailmentSchedules = (List <CurtailmentShedule>)Session["CurtUnitDuringSession"]; if (selectedCurtailmentSchedules != null && selectedCurtailmentSchedules.Count > 0) { rptViewerCurtailmentReceiptDuringSessionPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", selectedCurtailmentSchedules)); } return(rptViewerCurtailmentReceiptDuringSessionPrint); }
/* * * Frontend page : Report page * Title : Display Delete units report print page * Designed : Kanishka SHM * User story : * Developed : Kanishka SHM * Date created : 06/23/2016 * */ public ReportViewer PrintPage(int loanId, DateTime startDate, DateTime endDate) { //Check authentication session is null then return if (Session["AuthenticatedUser"] == null) { return(null); } User userData = (User)Session["AuthenticatedUser"]; //create reportviwer & set reportviewr properties ReportViewer rptViewerDeletedUnitsPrint = new ReportViewer(); rptViewerDeletedUnitsPrint.ProcessingMode = ProcessingMode.Local; rptViewerDeletedUnitsPrint.Reset(); rptViewerDeletedUnitsPrint.LocalReport.EnableExternalImages = true; rptViewerDeletedUnitsPrint.LocalReport.ReportPath = Server.MapPath("~/Reports/RptDeletedUnits.rdlc"); rptViewerDeletedUnitsPrint.ZoomMode = ZoomMode.PageWidth; //Get details of loan ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.TopHeaderDetails(loanId, userData.UserId); foreach (var dates in details) { dates.StartRange = startDate.ToString("MM/dd/yyyy"); dates.EndRange = endDate.ToString("MM/dd/yyyy"); dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } //set data set to report rptViewerDeletedUnitsPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); //Get all delete units details and set data set to report List <RptDeletedUnit> deletedUnits = ra.RptGetDeletedUnitByLoanIdDateRange(loanId, startDate, endDate); rptViewerDeletedUnitsPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", deletedUnits)); //return report viwer return(rptViewerDeletedUnitsPrint); }
/// <summary> /// Frontend Page: Report(monthly loan fee receipt) /// Title:load details of paid monthly loan fees /// Deigned:Piyumi Perera /// User story: /// Developed:Piyumi Perera /// Date created: /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int loanId = 0; //check selected loan id is not empty and assign to variable if (Request.QueryString["loanId"] != "") { loanId = Convert.ToInt32(Request.QueryString["loanId"]); } //check selected start date is not empty and assign to variable if (string.IsNullOrEmpty(Request.QueryString["startDate"])) { return; } var startDate = DateTime.ParseExact(Request.QueryString["startDate"], "MM/dd/yyyy", new CultureInfo("en-US")); //check selected end date is not empty and assign to variable if (string.IsNullOrEmpty(Request.QueryString["endDate"])) { return; } var endDate = DateTime.ParseExact(Request.QueryString["endDate"], "MM/dd/yyyy", new CultureInfo("en-US")); ReportAccess ra = new ReportAccess(); //get details of paid monthly loan fees List <RptFee> monthlyLoanFeeReceipt = ra.GetFeeReceiptByDateRange(loanId, "monthlyLoanFee", startDate, endDate); //check list count is >0 if (monthlyLoanFeeReceipt.Count > 0) { //load report RenderReport(loanId, startDate, endDate, monthlyLoanFeeReceipt); Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowFrame", "ShowDive();", true); } else { //show no data found message Page.ClientScript.RegisterStartupScript(this.GetType(), "HideFrame", "HideDive();", true); } } }
/// <summary> /// Frontend Page: Report Page(Curtailment Receipt Report) /// Title: Display Curtailment Receipt print page /// Designed: Kanishka SHM /// User story: /// Developed: Kanishka SHM /// Date created: /// </summary> public ReportViewer PrintPage(int loanId, DateTime startDate, DateTime endDate) { //check authentication session is null, if null return if (Session["AuthenticatedUser"] == null) { return(null); } User userData = (User)Session["AuthenticatedUser"]; //set report viewr property dynamically ReportViewer rptViewerCurtailmentReceiptPrint = new ReportViewer(); rptViewerCurtailmentReceiptPrint.ProcessingMode = ProcessingMode.Local; rptViewerCurtailmentReceiptPrint.Reset(); rptViewerCurtailmentReceiptPrint.LocalReport.EnableExternalImages = true; rptViewerCurtailmentReceiptPrint.LocalReport.ReportPath = Server.MapPath("~/Reports/RptCurtailmentReceipt.rdlc"); //get report header details ReportAccess ra = new ReportAccess(); List <LoanDetailsRpt> details = ra.TopHeaderDetails(loanId, userData.UserId); //add dates, date range and current date foreach (var dates in details) { dates.StartRange = startDate.ToString("MM/dd/yyyy"); dates.EndRange = endDate.ToString("MM/dd/yyyy"); dates.ReportDate = DateTime.Now.ToString("MM/dd/yyyy"); } //Get all active units curtailment paid details during time period List <CurtailmentShedule> curtailments = ra.GetCurtailmentPaidDetailsByDateRange(loanId, startDate, endDate); //set data source to report viwer rptViewerCurtailmentReceiptPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", details)); rptViewerCurtailmentReceiptPrint.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", curtailments)); //return reportviwer return(rptViewerCurtailmentReceiptPrint); }