• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

jasper with jsp

 
Ranch Hand
Posts: 158
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All

First of all i would like to inform that I am new to jsp.

I have code jsp with database and jasper report. It shows very well with my server.
But when i am connecting through my client computer it shows the html file only and report is generated at server.

I do not know where i made mistake. Can any body help me out.

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, you're creating a file on the server--it won't be magically downloaded. You need to stream it to the client.

Before going much further, please consider writing the Java code in a Java file--*not* in a JSP. This is an outdated practice and not even very suitable for quick testing; it's just not worth it.
 
Anand Karia
Ranch Hand
Posts: 158
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
David Newton

I would appreciate if you could guide me a bit in code means how and where to write it.
I wrote following lines but it shows error to me.
java.io.OutputStream outputStream = response.getOutputStream() ;
JasperExportManager.exportReportToPdfStream(jasperPrint, outputStream);
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please see ItDoesntWorkIsUseless and TellTheDetails. Saying "it shows error to me" gives me zero information that can be used to diagnose the problem.

Although I'd bet it's a illegal state when you try to get the output stream.
 
Lasagna is spaghetti flvored cake. Just like this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic