Cita:
grasias por su ayuda public boolean export() {
try {
DataOutputStream out = new DataOutputStream(new FileOutputStream(file));
WritableWorkbook w = Workbook.createWorkbook(out);
for (int index=0;index<tables.size();index++) {
JTable table=tables.get(index);
WritableSheet s = w.createSheet(nombreTabs.get(index), 0);
for (int i = 0; i < table.getColumnCount(); i++) {
for (int j = 0; j < table.getRowCount(); j++) {
if(i==3){
if(j>2){ //otras condiciones
// aqui vaal color de la celda
}
}
Object objeto = table.getValueAt(j, i);
s.addCell(new Label(i, j, String.valueOf(objeto)));
}
}
}
w.write();
w.close();
out.close();
return true;
} catch (IOException ex) {
ex.printStackTrace();
} catch (WriteException ex) {
ex.printStackTrace();
}
return false;
}
try {
DataOutputStream out = new DataOutputStream(new FileOutputStream(file));
WritableWorkbook w = Workbook.createWorkbook(out);
for (int index=0;index<tables.size();index++) {
JTable table=tables.get(index);
WritableSheet s = w.createSheet(nombreTabs.get(index), 0);
for (int i = 0; i < table.getColumnCount(); i++) {
for (int j = 0; j < table.getRowCount(); j++) {
if(i==3){
if(j>2){ //otras condiciones
// aqui vaal color de la celda
}
}
Object objeto = table.getValueAt(j, i);
s.addCell(new Label(i, j, String.valueOf(objeto)));
}
}
}
w.write();
w.close();
out.close();
return true;
} catch (IOException ex) {
ex.printStackTrace();
} catch (WriteException ex) {
ex.printStackTrace();
}
return false;
}