protected void generateSecondDefaultersExcell(string reportingdatefrom, string reportingdateto)
        {
            ReportingResultsManager reportingLogic = new ReportingResultsManager();
            DataTable dt = reportingLogic.getseconddefaulters(Convert.ToDateTime(reportingdateto), 31, 90);

            //IQWebUtils theUtils = new IQWebUtils();
            //theUtils.ExporttoExcel(dt, Response);
            using (XLWorkbook wb = new XLWorkbook())
            {
                String timeStamp = GetTimestamp(DateTime.Now);
                var    ws        = wb.Worksheets.Add(dt, "31to90days");
                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.Buffer      = true;
                HttpContext.Current.Response.Charset     = "";
                HttpContext.Current.Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
                HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + "Defaulters" + timeStamp + ".xlsx");
                using (MemoryStream MyMemoryStream = new MemoryStream())
                {
                    wb.SaveAs(MyMemoryStream);
                    MyMemoryStream.WriteTo(HttpContext.Current.Response.OutputStream);
                    HttpContext.Current.Response.Flush();
                    HttpContext.Current.Response.End();
                }
            }
        }
Пример #2
0
        public int getSecondStageDefaulters(string reportingdate, int mindays, int maxdays)
        {
            ReportingResultsManager reportingLogic = new ReportingResultsManager();
            int       seconddefaulters             = 0;
            DataTable theDT = reportingLogic.getseconddefaulters(Convert.ToDateTime(reportingdate), mindays, maxdays);

            seconddefaulters = theDT.Rows.Count;
            return(seconddefaulters);
        }
Пример #3
0
        public ArrayList getseconddefaultersll(string reportingdate, int mindays, int maxdays)
        {
            ReportingResultsManager reportingLogic = new ReportingResultsManager();
            DataTable theDT = reportingLogic.getseconddefaulters(Convert.ToDateTime(reportingdate), mindays, maxdays);
            ArrayList rows  = new ArrayList();
            int       n     = 0;

            foreach (DataRow items in theDT.Rows)
            {
                n = n + 1;
                string[] i = new string[13] {
                    n.ToString(), items["CCCNumber"].ToString(), items["FirstName"].ToString(), items["MiddleName"].ToString(), items["LastName"].ToString(), items["MobileNumber"].ToString(), Convert.ToDateTime(items["DispenseDate"]).ToString("dd-MMM-yyyy"), items["Drug"].ToString(), Convert.ToDateTime(items["ExpectedReturn"]).ToString("dd-MMM-yyyy"), items["DaysOverDue"].ToString(), items["Traced"].ToString(), items["PID"].ToString(), items["personid"].ToString()
                };
                rows.Add(i);
            }
            return(rows);
        }