Jump to content
We've recently updated our Privacy Statement, available here ×

allart

Members
  • Posts

    2
  • Joined

  • Last visited

allart's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. i tryed this too but i wrong something "impossible to open the file" Post Edited by allart at 07/07/2010 09:40 Code:ByteArrayOutputStream xlsReport = new ByteArrayOutputStream();//ServletOutputStream servletOutputStream = resp.getOutputStream();JRXlsExporter exporterXLS = new JRXlsExporter();exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT,print);exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE);exporterXLS.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, xlsReport);//exporterXLS.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, request.getRealPath("/reports") + "/" +title+".xls");exporterXLS.exportReport();System.out.println("Sixe of byte array:"+xlsReport.size()); bytes = xlsReport.toByteArray(); System.err.println("size: "+bytes.length); resp.setContentType("application/vnd.ms-excel"); resp.setContentLength(bytes.length); resp.getOutputStream().write(bytes); resp.getOutputStream().flush(); Post Edited by allart at 07/07/2010 09:43
  2. i've a problem to open report in xls, this is my code what'is the error? Code: Post Edited by allart at 07/07/2010 10:03 Post Edited by allart at 07/07/2010 10:04
×
×
  • Create New...