Exemplo n.º 1
0
 private int writeRows(
     int row, List<ProjectVariant> variants, List<ImpactCategoryDescriptor> impacts) {
   for (int i = 0; i < variants.size(); i++) {
     int col = i + 4;
     header(sheet, row, col, variants.get(i).getName());
   }
   row++;
   writeHeader(row++);
   for (ImpactCategoryDescriptor impact : impacts) {
     writeInfo(row, impact);
     ContributionSet<ProjectVariant> contributions = result.getContributions(impact);
     for (int i = 0; i < variants.size(); i++) {
       int col = i + 4;
       ProjectVariant variant = variants.get(i);
       ContributionItem<?> c = contributions.getContribution(variant);
       if (c == null) continue;
       Excel.cell(sheet, row, col, c.getAmount());
     }
     row++;
   }
   return row;
 }
Exemplo n.º 2
0
 private void header(Sheet sheet, int row, int col, String val) {
   Excel.cell(sheet, row, col, val).setCellStyle(headerStyle);
 }
Exemplo n.º 3
0
 void writeInfo(int row, ImpactCategoryDescriptor impact) {
   int col = 1;
   Excel.cell(sheet, row, col++, impact.getRefId());
   Excel.cell(sheet, row, col++, impact.getName());
   Excel.cell(sheet, row, col++, impact.getReferenceUnit());
 }