Exemplo n.º 1
0
        public ActionResult Pager(Models.CollectionReportModel data)
        {
            if (data.SearchString == null)
            {
                data.SearchString = "";
            }
            List <CLayer.CollectionReport> Reportlist = BLayer.Report.CollectionReport(data.FromDate, data.ToDate, (data.currentPage - 1) * data.Limit, data.Limit);

            ViewBag.Filter = new Models.SupplierPaymentReportModel();
            Models.CollectionReportModel forPager = new Models.CollectionReportModel()
            {
                SearchString = data.SearchString,
                SearchValue  = data.SearchValue,
                FromDate     = data.FromDate,
                ToDate       = data.ToDate,
                TotalRows    = 0,
                Limit        = 25,
                currentPage  = data.currentPage
            };
            if (Reportlist.Count > 0)
            {
                forPager.TotalRows = Reportlist[0].TotalRows;
            }
            ViewBag.Filter = forPager;
            return(PartialView("_Report", Reportlist));
        }
Exemplo n.º 2
0
        public ActionResult ReportPdf(string FromDate, string ToDate, int Limit, int currentPage)
        {
            //FromDate: pfromdate, ToDate: pToDate, Limit: pLimit, currentPage: pcurrentPage

            Models.CollectionReportModel   data = new Models.CollectionReportModel();
            List <CLayer.CollectionReport> Reportlist;

            try
            {
                DateTime fromD, toD;
                fromD = DateTime.Now;
                toD   = DateTime.Now.AddDays(10);
                DateTime.TryParse(FromDate, out fromD);
                DateTime.TryParse(ToDate, out toD);
                //if (data.SearchString == null) data.SearchString = "";
                Reportlist                = BLayer.Report.CollectionReport(fromD, toD, (currentPage - 1) * Limit, Limit);
                ViewBag.Filter            = new Models.SupplierPaymentReportModel();
                data.CollectionReportList = Reportlist;
                Models.CollectionReportModel forPager = new Models.CollectionReportModel()
                {
                    SearchString = data.SearchString,
                    SearchValue  = data.SearchValue,
                    FromDate     = data.FromDate,
                    ToDate       = data.ToDate,
                    TotalRows    = 0,
                    Limit        = 25,
                    currentPage  = data.currentPage
                };
                if (Reportlist.Count > 0)
                {
                    forPager.TotalRows = Reportlist[0].TotalRows;
                }
                ViewBag.Filter = forPager;

                // PartialView("_Report", Reportlist);

                data.ForPrint = true;
                data.ForPdf   = true;
            }
            catch (Exception ex)
            {
                Common.LogHandler.HandleError(ex);
            }
            return(new ViewAsPdf("Print", data.CollectionReportList)
            {
                PageOrientation = Rotativa.Options.Orientation.Landscape
            });
        }
Exemplo n.º 3
0
        public ActionResult ExcelReport(string FromDate, string ToDate, int Limit, int currentPage)
        {
            Models.CollectionReportModel   data = new Models.CollectionReportModel();
            List <CLayer.CollectionReport> Reportlist;

            try
            {
                DateTime fromD, toD;
                fromD = DateTime.Now;
                toD   = DateTime.Now.AddDays(10);
                DateTime.TryParse(FromDate, out fromD);
                DateTime.TryParse(ToDate, out toD);
                //if (data.SearchString == null) data.SearchString = "";
                Reportlist                = BLayer.Report.CollectionReport(fromD, toD, (currentPage - 1) * Limit, Limit);
                ViewBag.Filter            = new Models.SupplierPaymentReportModel();
                data.CollectionReportList = Reportlist;
                Models.CollectionReportModel forPager = new Models.CollectionReportModel()
                {
                    SearchString = data.SearchString,
                    SearchValue  = data.SearchValue,
                    FromDate     = data.FromDate,
                    ToDate       = data.ToDate,
                    TotalRows    = 0,
                    Limit        = 25,
                    currentPage  = data.currentPage
                };
                if (Reportlist.Count > 0)
                {
                    forPager.TotalRows = Reportlist[0].TotalRows;
                }
                ViewBag.Filter = forPager;
                data.ForPrint  = true;
                data.ForPdf    = true;
            }
            catch (Exception ex)
            {
                Common.LogHandler.HandleError(ex);
            }
            Response.ContentType = "application/vnd.ms-excel";
            Response.AppendHeader("content-disposition", "attachment; filename=report.xls");
            Response.Charset = "";
            return(View("~/Areas/Admin/Views/CollectionReport/Excel.cshtml", data.CollectionReportList));
        }
Exemplo n.º 4
0
 public ActionResult Index()
 {
     Models.CollectionReportModel data = new Models.CollectionReportModel();
     ViewBag.Filter = new Models.CollectionReportModel();
     return(View(data));
 }