public ActionResult PartialDailyReversalReport(string CardNo, string AccountNo, string BranchCode, DateTime?ApplicableDateFrom, DateTime?ApplicableDateTo, string RequestType, string CIF, DateTime?TransDate) { try { var maxEndDate = TransDate == null ? TransDate : CustomHelper.ConvertToMaxDate(TransDate); var data = new RequestDataAccess().GetDataForDailyReversal(CardNo, AccountNo, BranchCode, maxEndDate.GetValueOrDefault()); if (data.Rows.Count >= 1) { DataRow row = data.NewRow(); row[data.Columns[0].ColumnName.ToString()] = DBNull.Value; row[data.Columns[1].ColumnName.ToString()] = DBNull.Value; row[data.Columns[2].ColumnName.ToString()] = ""; row[data.Columns[3].ColumnName.ToString()] = ""; row[data.Columns[4].ColumnName.ToString()] = ""; row[data.Columns[5].ColumnName.ToString()] = ""; row[data.Columns[6].ColumnName.ToString()] = ""; row[data.Columns[7].ColumnName.ToString()] = data.Compute("Sum([" + data.Columns[7].ColumnName.ToString() + "])", "[" + data.Columns[7].ColumnName.ToString() + "] > 0"); row[data.Columns[8].ColumnName.ToString()] = data.Compute("Sum([" + data.Columns[8].ColumnName.ToString() + "])", "[" + data.Columns[8].ColumnName.ToString() + "] > 0"); row[data.Columns[9].ColumnName.ToString()] = ""; row[data.Columns[10].ColumnName.ToString()] = ""; row[data.Columns[11].ColumnName.ToString()] = ""; row[data.Columns[12].ColumnName.ToString()] = data.Compute("Sum([" + data.Columns[12].ColumnName.ToString() + "])", "[" + data.Columns[12].ColumnName.ToString() + "] > 0"); row[data.Columns[13].ColumnName.ToString()] = ""; row[data.Columns[14].ColumnName.ToString()] = ""; row[data.Columns[15].ColumnName.ToString()] = ""; row[data.Columns[16].ColumnName.ToString()] = ""; row[data.Columns[17].ColumnName.ToString()] = ""; row[data.Columns[18].ColumnName.ToString()] = data.Compute("Sum([" + data.Columns[18].ColumnName.ToString() + "])", "[" + data.Columns[18].ColumnName.ToString() + "] > 0"); row[data.Columns[19].ColumnName.ToString()] = ""; row[data.Columns[20].ColumnName.ToString()] = ""; row[data.Columns[21].ColumnName.ToString()] = ""; row[data.Columns[22].ColumnName.ToString()] = ""; row[data.Columns[23].ColumnName.ToString()] = ""; row[data.Columns[24].ColumnName.ToString()] = data.Compute("Sum([" + data.Columns[24].ColumnName.ToString() + "])", "[" + data.Columns[24].ColumnName.ToString() + "] > 0"); row[data.Columns[25].ColumnName.ToString()] = ""; row[data.Columns[26].ColumnName.ToString()] = ""; data.Rows.Add(row); } var viewModel = data.ToHTMLTable(Url.Action("Export", "Report")); return(Content(viewModel)); } catch (Exception ex) { throw ex; } }
public ActionResult PartialCurrentRecoveryReport(string CardNo, string AccountNo, string BranchCode, DateTime?StartDate, DateTime?EndDate, string RequestType, string CIF, DateTime?TransDate) { try { var minStartDate = StartDate == null ? StartDate : CustomHelper.ConvertToMinDate(StartDate); var maxEndDate = EndDate == null ? EndDate : CustomHelper.ConvertToMaxDate(EndDate); var data = new RequestDataAccess().GetDataForCurrentRecovery(CardNo, AccountNo, BranchCode, minStartDate.GetValueOrDefault(), maxEndDate.GetValueOrDefault(), RequestType, CIF); //***Add Row Total in datatable if (data.Rows.Count >= 1) { DataRow row = data.NewRow(); row[data.Columns[0].ColumnName.ToString()] = DBNull.Value; row[data.Columns[1].ColumnName.ToString()] = ""; row[data.Columns[2].ColumnName.ToString()] = ""; row[data.Columns[3].ColumnName.ToString()] = ""; row[data.Columns[4].ColumnName.ToString()] = ""; row[data.Columns[5].ColumnName.ToString()] = ""; row[data.Columns[6].ColumnName.ToString()] = data.Compute("Sum([" + data.Columns[6].ColumnName.ToString() + "])", "[" + data.Columns[6].ColumnName.ToString() + "] > 0"); row[data.Columns[7].ColumnName.ToString()] = data.Compute("Sum([" + data.Columns[7].ColumnName.ToString() + "])", "[" + data.Columns[7].ColumnName.ToString() + "] > 0"); row[data.Columns[8].ColumnName.ToString()] = data.Compute("Sum([" + data.Columns[8].ColumnName.ToString() + "])", "[" + data.Columns[8].ColumnName.ToString() + "] > 0"); row[data.Columns[9].ColumnName.ToString()] = ""; row[data.Columns[10].ColumnName.ToString()] = DBNull.Value; data.Rows.Add(row); } var viewModel = data.ToHTMLTable(Url.Action("Export", "Report")); return(Content(viewModel)); } catch (Exception ex) { throw ex; } }