- //群別摂取量
- private static int generateGroupSum(Sheet calcSheet, CellStylePool csPool, int rowIndex, Map<String,String> _namedAreaMap) {
-
- List<String> groupName = Arrays.asList("0", "穀類", "いも及びでん粉類", "砂糖及び甘味類", "豆類",
- "種実類", "野菜類", "果実類", "きのこ類", "藻類", "魚介類", "肉類", "卵類", "乳類",
- "油脂類", "菓子類", "し好飲料類", "調味料及び香辛料類", "調理加工食品類");
-
-
-
- Row groupRow = calcSheet.createRow(rowIndex);
- groupRow.createCell(1).setCellValue("食品群");
- groupRow.createCell(3).setCellValue("摂取量(g)");
- rowIndex++;
-
- for(int i = 1; i <= 18; i++,rowIndex++) {
- Row thisRow = calcSheet.createRow(rowIndex);
- thisRow.createCell(1).setCellValue(i);
- thisRow.createCell(2).setCellValue(groupName.get(i));
- Cell cCell = thisRow.createCell(3);
- cCell.setCellStyle(csPool.getCellStyle(""));
- //cCell.setCellFormula("SUMIF(AREA_GROUP, " + i + ", AREA_INTAKE)");
- cCell.setCellFormula("SUMIF(" + _namedAreaMap.get("AREA_GROUP") + ", " + i + ", " + _namedAreaMap.get("AREA_INTAKE") + ")");
-
- if(i == 6) {
- rowIndex++;
- thisRow = calcSheet.createRow(rowIndex);
- thisRow.createCell(2).setCellValue("うち 緑黄色野菜");
- Cell bcvCell = thisRow.createCell(3);
- bcvCell.setCellStyle(csPool.getCellStyle("0"));
- //bcvCell.setCellFormula("SUMIF(AREA_BRIGHT_COLORED_VEGETABLE, 1, AREA_INTAKE)");
- bcvCell.setCellFormula("SUMIF(" + _namedAreaMap.get("AREA_BRIGHT_COLORED_VEGETABLE") + ", 1, " + _namedAreaMap.get("AREA_INTAKE") + ")");
- }
-
-
- }
-
- return rowIndex;
- }