Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/02/2011, 04:40
Orantx
 
Fecha de Ingreso: enero-2011
Ubicación: Castellon
Mensajes: 39
Antigüedad: 13 años, 3 meses
Puntos: 5
Respuesta: Ejecutar archivo excel desde aplicacion Java en Win XP

Hola lo que yo hago es configurar el content type para que devuelva el excel:
Código Javascript:
Ver original
  1. response.setContentType("application/vnd.ms-excel");

y luego mando mis datos (en mi caso bytes):
Código JAVA:
Ver original
  1. ServletOutputStream ouputStream = response.getOutputStream();
  2. try {
  3.     ouputStream.write(bytes, 0, bytes.length);
  4.     ouputStream.flush();
  5. } catch (IOException e) {
  6.     e.printStackTrace();
  7.     if (ouputStream != null) {
  8.     try {
  9.         ouputStream.close();
  10.     } catch (IOException ex) {
  11.         ex.printStackTrace();
  12.        }
  13.    }
  14. }