-
- //PFCバランス
- private static int generatePfcBalance(Sheet calcSheet, CellStylePool csPool, int rowIndex, Map<String,String> _namedAreaMap) {
- Row pfbBalanceRow1 = calcSheet.createRow(rowIndex);
- pfbBalanceRow1.createCell(1).setCellValue("PFCバランス (%) 七訂の方法で計算したエネルギー量で計算");
- calcSheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 1, 2));
- pfbBalanceRow1.createCell(3).setCellValue("P");
- pfbBalanceRow1.createCell(4).setCellValue("F");
- pfbBalanceRow1.createCell(5).setCellValue("C");
-
- final String sumKiloCalorieCell = _namedAreaMap.get("SUM_KCAL");
-
- rowIndex++;
- Row pfbBalanceRow2 = calcSheet.createRow(rowIndex);
- Cell pCell = pfbBalanceRow2.createCell(3);
- pCell.setCellStyle(csPool.getCellStyle("0"));
- pCell.setCellFormula("ROUND(" + _namedAreaMap.get("SUM_P") + "*4*100/" + sumKiloCalorieCell + ",0)");
-
- Cell fCell = pfbBalanceRow2.createCell(4);
- fCell.setCellStyle(csPool.getCellStyle("0"));
- fCell.setCellFormula("ROUND(" + _namedAreaMap.get("SUM_F") + "*9*100/" + sumKiloCalorieCell + ",0)");
-
- Cell cCell = pfbBalanceRow2.createCell(5);
- cCell.setCellStyle(csPool.getCellStyle("0"));
- cCell.setCellFormula("100 - (" + new CellReference(cCell.getRowIndex(), 3).formatAsString() + " + "
- + new CellReference(cCell.getRowIndex(), 4).formatAsString() + ")");
-
- return rowIndex;
- }
-
-
- //PFCバランス(八訂)
- private static int generatePfcBalance8(Sheet calcSheet, CellStylePool csPool, int rowIndex, Map<String,String> _namedAreaMap) {
- Row pfbBalanceRow1 = calcSheet.createRow(rowIndex);
- pfbBalanceRow1.createCell(1).setCellValue("PFCバランス (%) 八訂のエネルギー量で計算");
- calcSheet.addMergedRegion(new CellRangeAddress(rowIndex, rowIndex, 1, 2));
- pfbBalanceRow1.createCell(3).setCellValue("P");
- pfbBalanceRow1.createCell(4).setCellValue("F");
- pfbBalanceRow1.createCell(5).setCellValue("C");
-
- final String sumKiloCalorieCell = _namedAreaMap.get("SUM_KCAL");
-
- rowIndex++;
- Row pfbBalanceRow2 = calcSheet.createRow(rowIndex);
- Cell pCell = pfbBalanceRow2.createCell(3);
- pCell.setCellStyle(csPool.getCellStyle("0"));
- pCell.setCellFormula("ROUND(" + _namedAreaMap.get("SUM_P_ENG") + "*4*100/" + sumKiloCalorieCell + ",0)");
-
- Cell fCell = pfbBalanceRow2.createCell(4);
- fCell.setCellStyle(csPool.getCellStyle("0"));
- fCell.setCellFormula("ROUND(" + _namedAreaMap.get("SUM_F_ENG") + "*9*100/" + sumKiloCalorieCell + ",0)");
-
- Cell cCell = pfbBalanceRow2.createCell(5);
- cCell.setCellStyle(csPool.getCellStyle("0"));
- cCell.setCellFormula("100 - (" + new CellReference(cCell.getRowIndex(), 3).formatAsString() + " + "
- + new CellReference(cCell.getRowIndex(), 4).formatAsString() + ")");
-
- return rowIndex;
- }
-
-