Jump to content

Problem with export my merged pdf


babo_g

Recommended Posts

Hi all,

i have a problem with this code : 

exporter.exportReport();

The jsp page error is here.I don't understand why...

My problem is that i need to create a merge pdf but i can't save a jrprint on hd.

Can u help me please tnx

Code:

 



Post Edited by babo_g at 02/01/2011 11:09
Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

This is a error in eclipse..

Code:
01-02-2011 12:37:43 | ERROR | - Errore applicativo inaspettato : nulljava.lang.ClassCastException	at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:367)	at it.gruppodatel.abci.action.matricepotenziale.stampa.ACT_IreportFactory.performTask(ACT_IreportFactory.java:102)	at it.gruppodatel.framework.action.BaseAction.execute(BaseAction.java:44)	at it.gruppodatel.abci.action.BaseABCIAction.execute(BaseABCIAction.java:93)	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)	at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)	at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)	at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)	at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)	at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)	at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)	at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)01-02-2011 12:37:43 | ERROR | - Errore applicativo inaspettato : null
Link to comment
Share on other sites

Okay, now I see the problem was created by the OUTPUT_FILE_NAME parameter. :)

You have 2 possibilities, when exporting a report:

  1. Use the OUTPUT_FILE export parameter, and set a java.io.File as parameter value:

exporter.setParameter(JRExporterParameter.OUTPUT_FILE, new File("U:/Repository/presentationBuilder.pdf"));

  1. Use the OUTPUT_FILE_NAME export parameter, and set a String representing the file name as parameter value:

exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,"U:/Repository/presentationBuilder.pdf");

In your sample you set the OUTPUT_FILE_NAME parameter with a File value, and this doesn't work.

Regards,
sanda

 



Post Edited by shertage at 02/01/2011 12:42
Link to comment
Share on other sites

  • 4 years later...

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...