|
@@ -253,6 +253,13 @@ func (c *PercentageController) Percentage_Export() {
|
|
|
line++
|
|
|
}
|
|
|
|
|
|
+ // ------------- 最后一行 合计 ------------------------
|
|
|
+ f.SetRowHeight("Sheet1", line, 22)
|
|
|
+ f.MergeCell("Sheet1", fmt.Sprintf("B%d", line), fmt.Sprintf("G%d", line))
|
|
|
+ f.SetCellValue("Sheet1", fmt.Sprintf("B%d", line), "合计")
|
|
|
+ f.SetCellFormula("Sheet1", fmt.Sprintf("%s%d", schemeEndCell, line), fmt.Sprintf("SUM(%s5:%s%d)", schemeEndCell, schemeEndCell, line-1))
|
|
|
+ f.SetCellFormula("Sheet1", fmt.Sprintf("%s%d", reportingEndCell, line), fmt.Sprintf("SUM(%s5:%s%d)", reportingEndCell, reportingEndCell, line-1))
|
|
|
+
|
|
|
Style4, _ := f.NewStyle(
|
|
|
&excelize.Style{
|
|
|
Font: &excelize.Font{Size: 11, Family: "宋体"},
|
|
@@ -317,7 +324,7 @@ func (c *PercentageController) Percentage_Export() {
|
|
|
Fill: excelize.Fill{Type: "pattern", Color: []string{"#92D050"}, Pattern: 1},
|
|
|
})
|
|
|
|
|
|
- f.SetCellStyle("Sheet1", "A5", fmt.Sprintf("%s%d", reportingEndCell, line-1), Style4)
|
|
|
+ f.SetCellStyle("Sheet1", "A5", fmt.Sprintf("%s%d", reportingEndCell, line), Style4)
|
|
|
|
|
|
f.SetCellStyle("Sheet1", schemeStartCell+"2", schemeEndCell+"4", StyleYellowFill)
|
|
|
f.SetCellStyle("Sheet1", schemeEndCell+"5", fmt.Sprintf("%s%d", schemeEndCell, line-1), StyleYellowFill1)
|
|
@@ -489,6 +496,13 @@ func (c *PercentageController) Percentage_User_Export() {
|
|
|
line++
|
|
|
}
|
|
|
|
|
|
+ // ------------- 最后一行 合计 ------------------------
|
|
|
+ f.SetRowHeight("Sheet1", line, 22)
|
|
|
+ f.MergeCell("Sheet1", fmt.Sprintf("B%d", line), fmt.Sprintf("G%d", line))
|
|
|
+ f.SetCellValue("Sheet1", fmt.Sprintf("B%d", line), "合计")
|
|
|
+ f.SetCellFormula("Sheet1", fmt.Sprintf("%s%d", schemeEndCell, line), fmt.Sprintf("SUM(%s5:%s%d)", schemeEndCell, schemeEndCell, line-1))
|
|
|
+ f.SetCellFormula("Sheet1", fmt.Sprintf("%s%d", reportingEndCell, line), fmt.Sprintf("SUM(%s5:%s%d)", reportingEndCell, reportingEndCell, line-1))
|
|
|
+
|
|
|
Style4, _ := f.NewStyle(
|
|
|
&excelize.Style{
|
|
|
Font: &excelize.Font{Size: 11, Family: "宋体"},
|
|
@@ -553,7 +567,7 @@ func (c *PercentageController) Percentage_User_Export() {
|
|
|
Fill: excelize.Fill{Type: "pattern", Color: []string{"#92D050"}, Pattern: 1},
|
|
|
})
|
|
|
|
|
|
- f.SetCellStyle("Sheet1", "A5", fmt.Sprintf("%s%d", reportingEndCell, line-1), Style4)
|
|
|
+ f.SetCellStyle("Sheet1", "A5", fmt.Sprintf("%s%d", reportingEndCell, line), Style4)
|
|
|
|
|
|
f.SetCellStyle("Sheet1", schemeStartCell+"2", schemeEndCell+"4", StyleYellowFill)
|
|
|
f.SetCellStyle("Sheet1", schemeEndCell+"5", fmt.Sprintf("%s%d", schemeEndCell, line-1), StyleYellowFill1)
|