hi, here is the sample code u may try it before that check u having the all api there needed for excel generation ,
Code:
ServletContext context = this.getServlet().getServletConfig().getServletContext();
JasperPrint jasperPrint = JasperFillManager.fillReport(context.getRealPath("/EmpDetails.jasper"),parameters,con);
ByteArrayOutputStream output = new ByteArrayOutputStream();
OutputStream outputfile= new FileOutputStream(new File(context.getRealPath("/EmpDetails.xls"));
JRXlsExporter exporterXLS = new JRXlsExporter();
exporterXLS.setParameter(JRXlsExporterParameter.JASPER_PRINT, jasperPrint);
exporterXLS.setParameter(JRXlsExporterParameter.OUTPUT_STREAM, output);
exporterXLS.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.FALSE);
exporterXLS.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, Boolean.TRUE);
exporterXLS.setParameter(JRXlsExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.TRUE);
exporterXLS.setParameter(JRXlsExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);
exporterXLS.exportReport();
outputfile.write(output.toByteArray());