Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Text reports using Servlets  RSS feed

 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
i want to write a servlet that generates report in text format using data read from database. i am confused over creating reports using servlets.
Can anybody please tell me how to create report in text format using servlets?


Thanks and Regards,
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's confusing you? You'd set the content type of the response to "text/plain" and emit the report data just as if you were writing to any other output stream.
 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was confused over what should be content type. i used text/html but output was coming on console.
I will try your suggestion and let you know.


Thanks and Regards,
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you want the report to be explicitly like crystal reports??
 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bibeault,
I tried your suggestion of "text/plain" but what ever i write is coming on browser window only. I tried res.setContentType("application/text"),and i got an alert window for saving file.

I want to show report in notepad. Is there MIME type to do so?
Please tell me a way to achieve this.


Thanks and Regards,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!