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

Exporting Jasper report to Text File


salmankhans87

Recommended Posts

Hello Every one,

                               I want  to export Jasper report to Text file instead of PDF file, for this I am using JRTextExporter API. for reports having no textfields its work fine, but I have a report that have multiple textfields when I tried to convert that Report thet give me ArrayOutOfBound Exception. any please help me.

in the attachment I have uploaded Jrxml file of my report

 

the stack trace is given:

java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException
    at java.lang.System.arraycopy(Native Method)
    at net.sf.jasperreports.engine.export.JRTextExporter.exportText(JRTextExporter.java:615)
    at net.sf.jasperreports.engine.export.JRTextExporter.exportElements(JRTextExporter.java:393)
    at net.sf.jasperreports.engine.export.JRTextExporter.exportPage(JRTextExporter.java:370)
    at net.sf.jasperreports.engine.export.JRTextExporter.exportReportToWriter(JRTextExporter.java:346)
    at net.sf.jasperreports.engine.export.JRTextExporter.exportReport(JRTextExporter.java:222)
    at com.example.reporttextexporter.ReporttextexporterApplication.make(ReporttextexporterApplication.java:156)
    at com.example.reporttextexporter.ReporttextexporterApplication.access$0(ReporttextexporterApplication.java:128)
    at com.example.reporttextexporter.ReporttextexporterApplication$1.buttonClick(ReporttextexporterApplication.java:49)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:512)
    at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
    at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
    at com.vaadin.ui.Button.fireClick(Button.java:550)
    at com.vaadin.ui.Button.changeVariables(Button.java:217)
    at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1451)
    at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1399)
    at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1318)
    at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:763)
    at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)
    at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Thanks for your reply paulo

first of all let me tell you that I successfully exported some reports to txt. but the problem occures in the above mentioned report that causes exception.

second thing is that it is one of the requirement of my client, so I have to fullfill my client requirent and they need text file not CSV file.

so please if you or some one else can help me.

regards,

Salman Khan

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...