lxl 2 years ago
parent
commit
6e611dd86d

+ 7 - 0
EMIS.Web/Controllers/StudentManage/StudentStatistics/StudentCountController.cs

@@ -112,5 +112,12 @@ namespace EMIS.Web.Controllers.StudentManage.StudentStatistics
                 return View();
             }
         }
+
+        public ActionResult StudentCountPDF(int? InSchoolStatusID)
+        {
+            var pdf = NewReportServices.StudentCountPDF(InSchoolStatusID);
+
+            return File(pdf.ToArray(), "application/pdf");
+        }
     }
 }

+ 5 - 5
EMIS.Web/Controllers/StudentManage/StudentStatistics/StudentStatisticsController.cs

@@ -22,11 +22,11 @@ namespace EMIS.Web.Controllers.StudentManage.StudentStatistics
             return View();
         }
 
-        public ActionResult StudentCountPDF(int? InSchoolStatusID)
-        {
-            var pdf = NewReportServices.StudentCountPDF(InSchoolStatusID);
+        //public ActionResult StudentCountPDF(int? InSchoolStatusID)
+        //{
+        //    var pdf = NewReportServices.StudentCountPDF(InSchoolStatusID);
 
-            return File(pdf.ToArray(), "application/pdf");
-        }
+        //    return File(pdf.ToArray(), "application/pdf");
+        //}
     }
 }

+ 30 - 1
ServiceLogic/EMIS.CommonLogic/Report/NewReportServices.cs

@@ -1627,11 +1627,35 @@ namespace EMIS.CommonLogic.Report
 
             var table = DateTableHelper.DataTableToList<StudentStatisticsDataView>(ds.Tables[0]);
             var title = table.FirstOrDefault().unicersityName + table.FirstOrDefault().schoolCode + "年级专业学籍统计表";
-            ws.Cells[0, 0].Value = title;
+            
 
             var classNoList = table.Select(x => x.classNo).Distinct().ToList();
             var collegeList = table.Select(x => x.collegeName).Distinct().ToList();
             var listByClassNo = table.GroupBy(x => new { x.collegeName, x.StandardsName, x.year, x.classNo }).ToList();
+
+            ws.Cells[0, 0].Value = title;
+            var titleRange = ws.Cells.CreateRange(0, 0, 1, classNoList.Count + 4);
+            var titlestyle = rh.BuildBorderStyleAndSize(wk);
+            titleRange.Merge();
+            StyleFlag titleFlag = new StyleFlag();
+            titleFlag.Borders = true;
+            titleFlag.Font = true;
+            titleFlag.VerticalAlignment = true;
+            titleFlag.HorizontalAlignment = true;
+            titleRange.ApplyStyle(titlestyle, titleFlag);
+            ws.Cells[1, 0].Value = "系所函授站";
+            ws.Cells[1, 0].SetStyle(style);
+            ws.Cells[2, 0].Value = "院系所专业";
+            ws.Cells[2, 0].SetStyle(style);
+            ws.Cells[3, 0].Value = "年级";
+            ws.Cells[3, 0].SetStyle(style);
+            ws.Cells[3 + classNoList.Count(), 0].Value = "总计";
+            ws.Cells[3 + classNoList.Count(), 0].SetStyle(style);
+            for (int i = 0; i < classNoList.Count(); i++)
+            {
+                ws.Cells[3 + i + 1, 0].Value = classNoList[i] + "班";
+                ws.Cells[3 + i + 1, 0].SetStyle(style);
+            }
             for (int i = 0; i < collegeList.Count(); i++)
             {
                 var college = collegeList[i];
@@ -1644,6 +1668,11 @@ namespace EMIS.CommonLogic.Report
                     {
                         var year = yearList[k];
                         var listByYearAndClassNo = listByClassNo.Where(x => x.Key.year == year).Select(x => new { x.Key.classNo, StudentCount = x.Sum(y => y.StudentCount) }).ToList();
+                        for (int m = 0; m < classNoList.Count(); m++)
+                        { 
+                            var classNo = classNoList[m];
+                            var listByClass = listByYearAndClassNo.Where(x => x.classNo == classNo).ToList();
+                        }
                     }
                 }
             }