File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes jasper with jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "jasper with jsp" Watch "jasper with jsp" New topic
Author

jasper with jsp

Anand Karia
Ranch Hand

Joined: Sep 25, 2004
Posts: 156

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.



Love is GOD and GOD is Love.
Anand Karia
IT Concretor.......
M/s. Anand Karia Concreting IT
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Sep 25, 2004
Posts: 156

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

Joined: Sep 29, 2008
Posts: 12617

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.
 
GeeCON Prague 2014
 
subject: jasper with jsp