Foros del Web » Programación para mayores de 30 ;) » Java »

Problema WritableSheet

Estas en el tema de Problema WritableSheet en el foro de Java en Foros del Web. Buenas tardes... Tengo el problema con el siguiente codigo. response.setContentType("application/vnd.ms-excel"); response.setHeader("Content-Disposition", "attachment; filename=reporteSquid.xls"); WritableWorkbook w = Workbook.createWorkbook(response.getOutputStream() ); try { for ( int j = ...
  #1 (permalink)  
Antiguo 22/10/2008, 18:42
 
Fecha de Ingreso: octubre-2008
Mensajes: 15
Antigüedad: 15 años, 6 meses
Puntos: 0
Problema WritableSheet

Buenas tardes...

Tengo el problema con el siguiente codigo.

response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition",
"attachment; filename=reporteSquid.xls");

WritableWorkbook w = Workbook.createWorkbook(response.getOutputStream() );

try {

for ( int j = 0; j < sIps.length; j++){
/*Aqui obtendre el query (sQuery) a ejecutar con un filtro por la variable IP*/

int iNumRen = 0;

Statement stmt = con.createStatement ();
ResultSet rs = stmt.executeQuery (sQuery);
int iNumCols = rs.getMetaData().getColumnCount ();

WritableSheet s = w.createSheet(sIps[j].toString().replace('\'', ' ').trim(), j);

while ( rs.next() ) {
for (int i=1; i<=iNumCols; i++) {
s.addCell(new Label(i, iNumRen, rs.getString(i)));
} // end for
iNumRen++;
} // end while
rs.close();
stmt.close();
}
w.write();
w.close();
} // end try



Me genera todas las hojas pero no me escribe la informacion a partir de la hoja 6 o escribe basura, si yo le hago un debug la informacion si es la correcta, no lleva basura, el problema es al escribir en el excel...

Si alguien sabe que es lo que sucede, le agradeceria su ayuda.
  #2 (permalink)  
Antiguo 27/10/2008, 19:28
 
Fecha de Ingreso: octubre-2008
Mensajes: 15
Antigüedad: 15 años, 6 meses
Puntos: 0
Respuesta: Problema WritableSheet

Nadie??? ='(
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:47.