Relatórios - IReport

2 respostas
A

Bom dia!
Estou com problemas em extrair relatórios criados no IReport em Excel. Estava funcionando normalmente e passou a dar um erro ao tentar extrair. O código utilizado para configurar impressão em excel é:

if (formato != null && formato.equals(Formato.XLS)) {			
			JRExporter 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();   
			return xlsReport.toByteArray();   
		}		
		return JasperExportManager.exportReportToPdf(print);

Ao tentar extrair, ocorre a seguinte mensagem de erro:

=========================================================================
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Servlet execution threw an exception
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

root cause

java.lang.NoSuchFieldError: IS_REMOVE_EMPTY_SPACE_BETWEEN_ROWS

pxt.redevalor.valornet.gui.bean.Relatorio.exportToPdf(Relatorio.java:47)

pxt.redevalor.valornet.servlet.EmitirRelatorioServlet.doGet(EmitirRelatorioServlet.java:52)

javax.servlet.http.HttpServlet.service(HttpServlet.java:697)

javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.

Aguardo opiniões. Obrigada! :smiley:

2 Respostas

kdoigor
assim funciona ?

assim funciona ?

A

Não, desse jeito não funciona.
E tem também que se funcionasse o relatório em excel não sairia bom.
Esta linha é necessária no código, só não sei porque está causando este erro. :cry:

Criado 30 de junho de 2009
Ultima resposta 30 de jun. de 2009
Respostas 2
Participantes 2