Ciao a tutti,
sto esportando i dati di una jtable , alcuni di essi sono dichiarati int e quindi nella table contents ho impostato le colonne relative come type integer.
A questo punto quando vado a formattare le celle relative del foglio excel, faccio così:
codice:
WritableCellFormat cellFormat3 = new WritableCellFormat(NumberFormats.INTEGER);
cellFormat3.setBackground(Colour.BRIGHT_GREEN);
cellFormat3.setAlignment(Alignment.CENTRE);
cellFormat3.setVerticalAlignment(VerticalAlignment.CENTRE);
cellFormat3.setBorder(Border.ALL, BorderLineStyle.THIN);
e poi
codice:
/*Riempimento dati */
for (int i = 1; i < tabellaMesi.getColumnCount(); i++) {
for (int j = 0; j < tabellaMesi.getRowCount(); j++) {
ws1.addCell(new Label(i + 3, j + 5, tabellaMesi.getValueAt(j, i), cellFormat3));
}
}
A questo punto mi da il seguente errore: incompatible types: Object can be converted to String
qui:
codice:
ws1.addCell(new Label(i + 3, j + 5, tabellaMesi.getValueAt(j, i), cellFormat3));
non capisco ..qualcuno può aiutarmi?
Grazie