Tenho um relatório em pdf que funciona tranqüilo. Estou tentando gerar esse mesmo relatório em xls, porém ocorre o erro abaixo:
SEVERE: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.export.JExcelApiExporter
javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.export.JExcelApiExporter
Segue abaixo trecho do meu código:
JasperPrint print = JasperFillManager.fillReport(pathRelativoArquivo, parametrosRelatorio, connection);
JExcelApiExporter exporter = new JExcelApiExporter();
ByteArrayOutputStream xlsReport = new ByteArrayOutputStream();
exporter.setParameter(JExcelApiExporterParameter.JASPER_PRINT, print);
exporter.setParameter(JExcelApiExporterParameter.OUTPUT_STREAM, xlsReport);
exporter.setParameter(JExcelApiExporterParameter.IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS, Boolean.TRUE);
exporter.setParameter(JExcelApiExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.TRUE);
exporter.setParameter(JExcelApiExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);
exporter.exportReport();
byte[] bytes = xlsReport.toByteArray();
Será que está faltando alguma lib?
Abraços,