public IndicatorEntryCalcTemplate(final IndicatorEntryData data, final SpreadsheetDocument exDoc) throws Throwable { this.data = data; Table table = null; String tableName = data.getLocalizedVersion("flexibleElementIndicatorsList").replace(" ", "_"); if (exDoc == null) { doc = SpreadsheetDocument.newSpreadsheetDocument(); table = doc.getSheetByIndex(0); table.setTableName(tableName); } else { doc = exDoc; table = doc.appendSheet(tableName); } coreCellStyle = CalcUtils.prepareCoreStyle(doc); int rowIndex = -1; int cellIndex = 0; // skip row ++rowIndex; // title CalcUtils.putMainTitle( table, ++rowIndex, data.getNumbOfCols(), data.getLocalizedVersion("flexibleElementIndicatorsList").toUpperCase()); // emptry row CalcUtils.putEmptyRow(table, ++rowIndex); // column headers row = table.getRowByIndex(++rowIndex); cellIndex = 0; CalcUtils.putHeader(row, ++cellIndex, data.getLocalizedVersion("name")); CalcUtils.putHeader(row, ++cellIndex, data.getLocalizedVersion("code")); CalcUtils.putHeader(row, ++cellIndex, data.getLocalizedVersion("targetValue")); CalcUtils.putHeader(row, ++cellIndex, data.getLocalizedVersion("value")); row.setHeight(5, false); // empty row row = table.getRowByIndex(++rowIndex); row.setHeight(3.8, false); row.getCellByIndex(1).setCellStyleName(null); row.getCellByIndex(2).setCellStyleName(null); row.getCellByIndex(3).setCellStyleName(null); row.getCellByIndex(4).setCellStyleName(null); for (final IndicatorGroup group : data.getIndicators().getGroups()) { row = table.getRowByIndex(++rowIndex); CalcUtils.putGroupCell(table, 1, rowIndex, group.getName()); CalcUtils.mergeCell(table, 1, rowIndex, data.getNumbOfCols(), rowIndex); for (final IndicatorDTO indicator : group.getIndicators()) { // indicator's detail sheet createDetailSheet(indicator); row = table.getRowByIndex(++rowIndex); // ind name cell = CalcUtils.createBasicCell(table, 1, rowIndex, null); CalcUtils.applyLink( cell, indicator.getName(), ExportConstants.INDICATOR_SHEET_PREFIX + indicator.getName()); // code CalcUtils.createBasicCell(table, 2, rowIndex, indicator.getCode()); // target putValueCell(table, rowIndex, 3, indicator.getObjective(), true); // current value putValueCell(table, rowIndex, 4, data.getFormattedValue(indicator), true); } } table.getColumnByIndex(0).setWidth(3.8); table.getColumnByIndex(1).setWidth(83); table.getColumnByIndex(2).setWidth(55); table.getColumnByIndex(3).setWidth(55); table.getColumnByIndex(4).setWidth(55); }