main
黄海 7 months ago
parent dc334ca60d
commit 2ab5c66834

Binary file not shown.

@ -146,6 +146,16 @@ public class ExportExcel {
districtMergeStartRow, rowNum - 1, 0, 0));
}
// 合并表头中的"年份"列
sheet.addMergedRegion(new CellRangeAddress(0, 0, 1, 2));
// 为合并后的单元格重新设置样式(避免合并后样式丢失)
Cell mergedCell = headerRow.getCell(1);
if (mergedCell != null) {
mergedCell.setCellValue("年份");
mergedCell.setCellStyle(headerStyle);
}
// 保存文件
try (FileOutputStream fileOut = new FileOutputStream(filePath)) {
workbook.write(fileOut);

@ -154,7 +154,9 @@
FROM excel__c04222fd74
WHERE = '乡村'
GROUP BY )
UNION ALL
(SELECT
,
'在园幼儿数' as ,
@ -178,14 +180,13 @@
ORDER BY ,
CASE
WHEN '入园数' THEN 1
WHEN '在园' THEN 2
WHEN '在园幼儿' THEN 2
END,
CASE
WHEN '总入园数' THEN 1
WHEN '总在园数' THEN 1
WHEN '城区' THEN 2
WHEN '镇区' THEN 3
WHEN '乡村' THEN 4
WHEN '城区' THEN 1
WHEN '镇区' THEN 2
WHEN '乡村' THEN 3
WHEN '总数' THEN 4
END;
#end
#end
Loading…
Cancel
Save