This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jasper with jsp

 
Anand Karia
Ranch Hand
Posts: 156
Java
  • 0
  • Mark post as helpful
  • send pies
  • 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.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • 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: 156
Java
  • 0
  • Mark post as helpful
  • send pies
  • 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
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic