예제 #1
0
        public ReportResult ChequeBookReport(int pgId = 1)
        {
            ReportGenerator reportGen = new ReportGenerator();
            //string rname = userManager.getReportbyName(pgId);
            string rname = _repository.Fetch<ChequeReport>().Single(p => p.report_Id == pgId).reportName;
            ViewBag.msgTitle = rname;
            ViewBag.Title = rname;

            var query = reportGen.getCheckBookReportsexel(rname);
            //if (!column.Contains(""))
            //{
            //    if (!item.Contains(""))
            //    {
            //    //    query = reportGen.getCheckBookReports(rname);

            //        query = reportGen.getCheckBookReports(rname.Trim(), column.Trim(), item.Trim());
            //    }
            //}

            //  var query = reportGen.getCheckBookReports(rname);
            var report = new Report(query.ToReportSource());
            // Customize the Text Fields
            report.TextFields.Title = rname;//"User Menus Report";
            //     report.TextFields.SubTitle = "This is a sample report showing how Doddle Report works";
            report.TextFields.Footer = "\n\n Copyright 2015 (c) Citi";
            // Render hints allow you to pass additional hints to the reports as they are being rendered
            report.RenderHints.BooleanCheckboxes = true;
            report.RenderHints.BooleansAsYesNo = true;
            report.RenderHints.FreezeRows = 9;
            report.RenderHints.FreezeColumns = 5;

            return new ReportResult(report);
        }
예제 #2
0
 //
 // GET: /ChqBkFields/Details/5
 public ActionResult Details(int id = 0)
 {
     ReportGenerator reportGen = new ReportGenerator();
     String rname = "UnProcessed Requests";
     chqBook_CheckBookFieldDec chqbook_checkbookfielddec = db.chqBook_CheckBookFieldDecs.Find(id);
     if (chqbook_checkbookfielddec == null)
     {
         return HttpNotFound();
     }
     return View(chqbook_checkbookfielddec);
     var query = reportGen.getCheckBookReports(rname);
 }
예제 #3
0
        public ActionResult ChequeBookReports(string fromDate, string toDate, int? page, int id = 1)
        {
            var reportGen = new ReportGenerator();
            //string rname = userManager.getReportbyName(id);
            string rname = _repository.Fetch<ChequeReport>().Single(p => p.report_Id == id).reportName;
            ViewBag.toDate = toDate;
            ViewBag.msgTitle = rname;
            ViewBag.Title = rname;
            ViewBag.pgId = id;
            //     return View(reportGen.getCheckBookReports(rname));

            if (rname.Contains("Collected Check Books Report"))
            {

                return RedirectToAction("CollectedChequeBookReport");
                //var itemz = reportGen.getCollecetdCheckBookReports(rname);
                //var pageNumber = page ?? 1;
                //var pageObj = itemz.ToPagedList(pageNumber, 25);
                //ViewBag.pageObj = pageObj;

            }
            if (rname.Contains("Destroyed Check Books Report"))
            {

                return RedirectToAction("DestroyedCheckBookReport");
                //var itemz = reportGen.getCollecetdCheckBookReports(rname);
                //var pageNumber = page ?? 1;
                //var pageObj = itemz.ToPagedList(pageNumber, 25);
                //ViewBag.pageObj = pageObj;

            }
            else
            {
                var items = reportGen.getCheckBookReports(rname);
                var pageNumber = page ?? 1;
                var pageObj = items.ToPagedList(pageNumber, 25);
                ViewBag.pageObj = pageObj;
            }

            return View();
        }
예제 #4
0
        public ActionResult Index()
        {
            ReportsMap reports = new ReportsMap();
            var reportsx = new List<ReportsMap>();

            ReportGenerator reportGen = new ReportGenerator();

            return View();
        }
예제 #5
0
        public ReportResult destroyedexcel(int pgId = 1)
        {
            ReportGenerator reportGen = new ReportGenerator();
            //string rname = userManager.getReportbyName(pgId);
            string rname = "Destroy Check Books";
            ViewBag.msgTitle = rname;
            ViewBag.Title = rname;

            var query = reportGen.getCheckBookReportspend(rname);

            //  var query = reportGen.getCheckBookReports(rname);
            var report = new Report(query.ToReportSource());
            // Customize the Text Fields
            report.TextFields.Title = rname;//"User Menus Report";
            //     report.TextFields.SubTitle = "This is a sample report showing how Doddle Report works";
            report.TextFields.Footer = "\n\n Copyright 2015 (c) Citi";
            // Render hints allow you to pass additional hints to the reports as they are being rendered
            report.RenderHints.BooleanCheckboxes = true;
            report.RenderHints.BooleansAsYesNo = true;
            report.RenderHints.FreezeRows = 9;
            report.RenderHints.FreezeColumns = 2;

            return new ReportResult(report);
        }
예제 #6
0
        public ActionResult DestroyedCheckBookReportReportSearch(int? page, int id = 1)
        {
            var fromDate = Request["fromDate"];
            var toDate = Request["toDate"];

            string column = Request["column"];
            var creteria = Request["creteria"];
            var item = Request["item"];
            var reportGen = new ReportGenerator();
            string rname = "Destroyed Check Books Report";
            ViewBag.msgTitle = rname;
            ViewBag.Title = rname;

            ViewBag.msgTitle = rname;
            ViewBag.Title = rname;
            ViewBag.pgId = id;

            //     return View(reportGen.getCheckBookReports(rname));

            //put serat for the checkbooks here
            if (fromDate != null && fromDate != "" && toDate != null && toDate != "") ///search that has date included
            {
                DateTime fromDate_ = new DateTime();
                DateTime toDate_ = new DateTime();
                try
                {
                    fromDate_ = Convert.ToDateTime(fromDate);
                    ViewBag.fromDate = fromDate;
                }
                catch (Exception ex) { }
                try
                {
                    toDate_ = DateTime.Parse(toDate);
                    toDate_ = Convert.ToDateTime(toDate).AddDays(1.0);
                    ViewBag.toDate = toDate;
                }
                catch (Exception ex) { }

                var items = reportGen.getdestrCheckBookReports_withdate(rname.Trim(), column.Trim(), item.Trim(), fromDate, toDate);
                var pageNumber = page ?? 1;
                var pageObj = items.ToPagedList(pageNumber, 25);
                ViewBag.pageObj = pageObj;
            }
            else ///search without date
            {
                var items = reportGen.getCheckBookReports(rname.Trim(), column.Trim(), item.Trim());
                var pageNumber = page ?? 1;
                var pageObj = items.ToPagedList(pageNumber, 25);
                ViewBag.pageObj = pageObj;

            }
            return View();
        }
예제 #7
0
        public ActionResult DestroyedCheckBookReport(int? page, int id = 1)
        {
            var fromDate = Request["fromDate"];
            var toDate = Request["toDate"];
            string column = Request["column"];
            var creteria = Request["creteria"];
            var item = Request["item"];
            var reportGen = new ReportGenerator();
            string rname = "Destroyed Check Books Report";
            ViewBag.msgTitle = "Destroyed Check Books Report";
            ViewBag.Title = "Destroyed Check Books Report";
            ViewBag.pgId = id;

            var itemz = reportGen.getdestCheckBookReports(rname);
            //var itemz = reportGen.getdestmap(rname);
            var pageNumber = page ?? 1;
            var pageObj = itemz.ToPagedList(pageNumber, 25);
            ViewBag.pageObj = pageObj;

            return View();
        }
예제 #8
0
        public ActionResult DestroyedCheckBookRe(int? page, int id = 1)
        {
            var reportGen = new ReportGenerator();
            //string rname = userManager.getReportbyName(id);
            string rname = _repository.Fetch<ChequeReport>().Single(p => p.report_Id == id).reportName;
            ViewBag.msgTitle = "Destroyed Check Books Report";
            ViewBag.Title = "Destroyed Check Books Report";
            ViewBag.pgId = id;

            var itemz = reportGen.getCollecetdCheckBookReports(rname);
            var pageNumber = page ?? 1;
            var pageObj = itemz.ToPagedList(pageNumber, 25);
            ViewBag.pageObj = pageObj;

            return View();
        }
예제 #9
0
        public ReportResult collChequeBookReport(int pgId = 1)
        {
            var reportGen = new ReportGenerator();

            string rname = "Collected Check Books";

            var query = reportGen.getCollecetdCheckBookReports(rname);

            var report = new Report(query.ToReportSource());
            // Customize the Text Fields
            report.TextFields.Title = rname;//"User Menus Report";
            //     report.TextFields.SubTitle = "This is a sample report showing how Doddle Report works";
            report.TextFields.Footer = "\n\n Copyright 2015 (c) Citi";
            // Render hints allow you to pass additional hints to the reports as they are being rendered
            report.RenderHints.BooleanCheckboxes = true;
            report.RenderHints.BooleansAsYesNo = true;
            report.RenderHints.FreezeRows = 9;
            report.RenderHints.FreezeColumns = 5;

            return new ReportResult(report);
        }
예제 #10
0
        //[HttpPost]
        public ActionResult ChequeBookReportsSearch(int? page, int id = 1)
        {
            var fromDate = Request["fromDate"];
            var toDate = Request["toDate"];

            string column = Request["column"];
            var creteria = Request["creteria"];
            var item = Request["item"];
            string reportType = Request["reportType"];
            int reportId = Int32.Parse(reportType);
            //int reportId = Int32.Parse(reportType);
            ReportGenerator reportGen = new ReportGenerator();
            //string rname = userManager.getReportbyName(reportId);
            string rname = _repository.Fetch<ChequeReport>().Single(p => p.report_Id == reportId).reportName;
            ViewBag.msgTitle = rname;
            ViewBag.Title = rname;

            ViewBag.msgTitle = rname;
            ViewBag.Title = rname;
            ViewBag.pgId = reportId;
            if (rname.Contains("Collected Check Books Report"))
            {

                return RedirectToAction("CollectedChequeBookReport");
                //var itemz = reportGen.getCollecetdCheckBookReports(rname);
                //var pageNumber = page ?? 1;
                //var pageObj = itemz.ToPagedList(pageNumber, 25);
                //ViewBag.pageObj = pageObj;

            }
            if (rname.Contains("Destroyed Check Books Report"))
            {

                return RedirectToAction("DestroyedCheckBookReport");
                //var itemz = reportGen.getCollecetdCheckBookReports(rname);
                //var pageNumber = page ?? 1;
                //var pageObj = itemz.ToPagedList(pageNumber, 25);
                //ViewBag.pageObj = pageObj;

            }
            else

                //     return View(reportGen.getCheckBookReports(rname));

                //put serat for the checkbooks here
                if (fromDate != null && fromDate != "" && toDate != null && toDate != "") ///search that has date included
                {
                    DateTime fromDate_ = new DateTime();
                    DateTime toDate_ = new DateTime();
                    try
                    {
                        fromDate_ = Convert.ToDateTime(fromDate);
                        ViewBag.fromDate = fromDate;
                    }
                    catch (Exception ex) { }
                    try
                    {
                        toDate_ = DateTime.Parse(toDate);
                        toDate_ = Convert.ToDateTime(toDate).AddDays(1.0);
                        ViewBag.toDate = toDate;
                    }
                    catch (Exception ex) { }

                    var items = reportGen.getCheckBookReports_withdate(rname.Trim(), column.Trim(), item.Trim(), fromDate, toDate);
                    var pageNumber = page ?? 1;
                    var pageObj = items.ToPagedList(pageNumber, 25);
                    ViewBag.pageObj = pageObj;
                }
                else ///search without date
                {
                    var items = reportGen.getCheckBookReports(rname.Trim(), column.Trim(), item.Trim());
                    var pageNumber = page ?? 1;
                    var pageObj = items.ToPagedList(pageNumber, 25);
                    ViewBag.pageObj = pageObj;

                }
            return View();
        }
예제 #11
0
        //   public ReportResult showLetter(int idx=11)
        public ActionResult showLetter(ChkBook_collectorDetail collectionForm)
        {
            int idx = collectionForm.checkbookId;
            ReportGenerator reportGen = new ReportGenerator();
            string rname = "";//userManager.getReportbyName(pgId);
            ViewBag.msgTitle = rname;
            ViewBag.Title = rname;
            // Customize the Text Fields
            ReportsMap rep = new ReportsMap();
            rep.fieldId = 1;
            rep.field1 = "";
            rep.field2 = "";
            rep.field3 = "";
            rep.field4 = "";
            rep.field5 = "";
            var reportList = new List<ReportsMap>();
            reportList.Add(rep);
            var report = new Report(reportList.ToReportSource());
            string data1 = "---", data2 = "", data3 = "", data4 = "";
            //Read File
            string fileName = fngetSystemParamter("COLLECTION LETTER TEMPLATE");
            string agent = collectionForm.FullNames;

            Document myDocument = new Document(PageSize.A4.Rotate());

            try
            {
                    string fileLocation = HttpContext.Server.MapPath(".") + @"\Letter\" + "collection.pdf";
                    if (!Directory.Exists(HttpContext.Server.MapPath(".") + @"\Letter\"))
                    {
                        Directory.CreateDirectory(HttpContext.Server.MapPath(".") + @"\Letter\");
                    }
                    if (System.IO.File.Exists(fileLocation))
                    {
                        System.IO.File.Delete(fileLocation);
                    }

                    PdfWriter.GetInstance(myDocument, new FileStream(fileLocation, FileMode.OpenOrCreate));
                myDocument.Open();

                Contacts contactObj = new Contacts();//"0100047012"

                chqBook_CheckBookFieldDec chkBkFields = db.chqBook_CheckBookFieldDecs.Single(p => p.checkbookId == idx);
                List<Contacts> contactsList = db.ContactsList.Where(p => p.Customer_No == chkBkFields.acc_no).ToList<Contacts>();
                int i = 0;
                foreach (Contacts contactmodel in contactsList)
                {
                    if (i == 0)
                    {
                        contactObj = contactmodel;
                    }
                    i++;
                }

                string[] lines = System.IO.File.ReadAllLines(fileName);
                string[] data;
                string printData = "";
                string footerText = "";
                int footerCount = 0;
                foreach (string lin in lines)
                {
                    string tempData = lin;

                    if (lin.Contains("<<date>>"))
                    {
                        tempData = DateTime.Now.ToString("MMMM") + " " + DateTime.Today.Day.ToString() + " , " + DateTime.Today.Year.ToString(); ; //lin.Replace("<<Flex_Name>>", contactObj.Customer_Name);
                    }

                    if (lin.Contains("<<Flex_Name>>"))
                    {
                        tempData = lin.Replace("<<Flex_Name>>", contactObj.Customer_Name);
                    }
                    if (lin.Contains("<<Address_Line_1>>"))
                    {
                        tempData = lin.Replace("<<Address_Line_1>>", contactObj.Address_Line1);
                    }
                    if (lin.Contains("<<Address_Line_2>>"))
                    {
                        tempData = lin.Replace("<<Address_Line_2>>", contactObj.Address_Line2);
                    }
                    if (lin.Contains("<<SERIES>>"))
                    {
                        tempData = lin.Replace("<<SERIES>>", collectionForm.Series);
                    }
                    if (tempData.Contains("<<NO_OF_BOOKS>>"))
                    {
                        tempData = tempData.Replace("<<NO_OF_BOOKS>>", collectionForm.no_of_books);
                    }

                    if (lin.Contains("<<Account_No>>"))
                    {
                        tempData = lin.Replace("<<Account_No>>", chkBkFields.acc_no);
                    }

                    if (lin.Contains("<<AGENT>>"))
                    {
                        tempData = lin.Replace("<<AGENT>>", agent);
                    }
                    if (tempData.Contains("<<ISSUED>>"))
                    {
                        tempData = tempData.Replace("<<ISSUED>>", System.DateTime.Now.ToString("dd-MMM-yyyy"));
                    }
                    if (tempData.Contains("Citibank, N.A."))
                    {
                        footerCount = 1;
                    }
                    if (footerCount == 0)
                    {
                        printData = printData + tempData + "\n";
                    }
                    else
                    {
                        footerText = footerText + tempData + "\n";
                    }
                }
                //  }

                report.TextFields.Header = printData;
                report.TextFields.Footer = footerText;

                myDocument.Add(new Paragraph(printData));
                myDocument.Add(new Paragraph(footerText));

                //myDocument.Close();

                report.RenderHints.BooleanCheckboxes = true;
                report.RenderHints.BooleansAsYesNo = true;
                report.RenderHints.FreezeRows = 9;
                report.RenderHints.FreezeColumns = 2;

                // Customize the data fields
                report.DataFields["fieldId"].Hidden = true;
                // report.DataFields["field1"].Hidden = true;
                report.DataFields["field1"].HeaderText = " ";//  .DataFormatString="{0:c}";
                report.DataFields["field2"].Hidden = true;
                report.DataFields["field3"].Hidden = true;
                report.DataFields["field4"].Hidden = true;
                report.DataFields["field5"].Hidden = true;
                report.DataFields["field6"].Hidden = true;
            }
            catch (DocumentException de)
            {
                Console.Error.WriteLine(de.Message);
            }
            finally
            {
                myDocument.Close();
            }
            //    // Return the ReportResult
            //    // the type of report that is rendered will be determined by the extension in the URL (.pdf, .xls, .html, etc)

            //return new ReportResult();
            return RedirectToAction("CollectionLetterpdf");
        }
예제 #12
0
        public ReportResult currentinventexcel(int pgId = 1)
        {
            ReportGenerator reportGen = new ReportGenerator();
            string rname = "Current Checkbook Inventory Report";
            ViewBag.msgTitle = rname;
            ViewBag.Title = rname;

            var query = reportGen.getCheckBookReports2(rname);

            var report = new Report(query.ToReportSource());
            // Customize the Text Fields
            report.TextFields.Title = rname;//"User Menus Report";
            report.TextFields.Footer = "\n\n Copyright 2015 (c) Citi";
            // Render hints allow you to pass additional hints to the reports as they are being rendered
            report.RenderHints.BooleanCheckboxes = true;
            report.RenderHints.BooleansAsYesNo = true;
            report.RenderHints.FreezeRows = 9;
            report.RenderHints.FreezeColumns = 2;

            return new ReportResult(report);
        }
예제 #13
0
        //
        // GET: /Contacts/Details/5
        public ActionResult Createconts(int? page, string id)
        {
            ReportGenerator reportGen = new ReportGenerator();
            string myuser = User.Identity.Name;
            string userHostAddress = HttpContext.Request.UserHostAddress;
            var model = _userManager.FindById(id);

            string rname = "Customer";
            var items = reportGen.getCustomermap(rname);

            var pageNumber = page ?? 1; // if no page was specified in the querystring, default to the first page (1)
            var pageObj = items.ToPagedList(pageNumber, 25); // will only contain 25 products max because of the pageSize

            _getVals.LogAudit(User.Identity.GetUserName(), "Created", Request.UserHostName, "Created Contacts", "Create", "Contacts");

            ViewBag.pageObj = pageObj;
            return View();
        }
예제 #14
0
        public ReportResult contactexcel(int pgId = 1)
        {
            ReportGenerator reportGen = new ReportGenerator();
            string rname = "Contacts";
            ViewBag.msgTitle = rname;
            ViewBag.Title = rname;
            var query = reportGen.getcontactsexel(rname);
            var report = new Report(query.ToReportSource());
            // Customize the Text Fields
            report.TextFields.Title = rname;
            report.TextFields.Footer = "\n\n Copyright 2015 (c) Citi";
            report.RenderHints.BooleanCheckboxes = true;
            report.RenderHints.BooleansAsYesNo = true;
            report.RenderHints.FreezeRows = 9;
            report.RenderHints.FreezeColumns = 2;

            return new ReportResult(report);
        }