cfIntRightBold.setAlignment(Alignment.RIGHT);
WritableCellFormat cfIntRight = new WritableCellFormat(wfNormal, df_);
cfIntRight.setAlignment(Alignment.RIGHT);
Label cellValue;
Number cellNumber;
int col = 0;
cellValue = new Label(col, 2, "", cfBold);
sheet.setColumnView(col, 10);
sheet.addCell(cellValue);
col++;
cellValue = new Label(col, 2, "Gruppo", cfBold);
sheet.setColumnView(col, 10);
sheet.addCell(cellValue);
col++;
cellValue = new Label(col, 2, "Mastro", cfBold);
sheet.setColumnView(col, 10);
sheet.addCell(cellValue);
if(visible)
{
col++;
cellValue = new Label(col, 2, "Conto", cfBold);
sheet.setColumnView(col, 10);
sheet.addCell(cellValue);
}
col++;
cellValue = new Label(col, 2, "Descrizione", cfBold);
sheet.setColumnView(col, 40);
sheet.addCell(cellValue);
col++;
cellValue = new Label(col, 2, "Dare", cfBold);
sheet.setColumnView(col, 20);
sheet.addCell(cellValue);
col++;
cellValue = new Label(col, 2, "Avere", cfBold);
sheet.setColumnView(col, 20);
sheet.addCell(cellValue);
col++;
cellValue = new Label(col, 2, "Dare extr.", cfBold);
sheet.setColumnView(col, 20);
sheet.addCell(cellValue);
col++;
cellValue = new Label(col, 2, "Avere Extr.", cfBold);
sheet.setColumnView(col, 20);
sheet.addCell(cellValue);
col++;
cellValue = new Label(col, 2, "Saldo Dare", cfBold);
sheet.setColumnView(col, 20);
sheet.addCell(cellValue);
col++;
cellValue = new Label(col, 2, "Saldo Avere", cfBold);
sheet.setColumnView(col, 20);
sheet.addCell(cellValue);
int riga = 2;
for (RowBilancio bilancio : listaBilancio)
{
riga++;
col = 0;
if((StringUtility.checkNull(bilancio.getTipoAttivita())).equals(" ")) {
cellValue = new Label(col, riga, "", cfNormal);
} else {
cellValue = new Label(col, riga, StringUtility.checkNull(bilancio.getTipoAttivita()), cfBold);
}
sheet.addCell(cellValue);
col++;
if((StringUtility.checkNull(bilancio.getGruppo())).equals(" ")) {
cellValue = new Label(col, riga, "", cfIntNumber);
sheet.addCell(cellValue);
} else {
cellNumber = new Number(col, riga, Integer.parseInt((StringUtility.checkNull(bilancio.getGruppo()))), cfIntRightBold);
sheet.addCell(cellNumber);
}
col++;
if((StringUtility.checkNull(bilancio.getMastro())).equals(" ")) {
cellValue = new Label(col, riga, "", cfIntNumber);
sheet.addCell(cellValue);
} else {
cellNumber = new Number(col, riga, Integer.parseInt((StringUtility.checkNull(bilancio.getMastro()))), cfIntRight);
sheet.addCell(cellNumber);
}
if(visible)
{
col++;
if((StringUtility.checkNull(bilancio.getConto())).equals(" ")) {
cellValue = new Label(col, riga, "", cfIntNumber);
sheet.addCell(cellValue);
} else {
cellNumber = new Number(col, riga, Integer.parseInt((StringUtility.checkNull(bilancio.getConto()))), cfIntRight);
sheet.addCell(cellNumber);
}
}
col++;
if((StringUtility.checkNull(bilancio.getDescrizione())).equals(" ")) {
cellValue = new Label(col, riga, "", cfNormal);
} else {
if(NumberUtils.checkNull(bilancio.getTipoRiga()) == 0 || NumberUtils.checkNull(bilancio.getTipoRiga()) == 1
|| NumberUtils.checkNull(bilancio.getTipoRiga()) == 2) {
cellValue = new Label(col, riga, StringUtility.checkNull(bilancio.getDescrizione()), cfBold);
} else {
cellValue = new Label(col, riga, StringUtility.checkNull(bilancio.getDescrizione()), cfNormal);
}
}
sheet.addCell(cellValue);
col++;