Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to download current page from excel format using java or serlet or jsp  RSS feed

 
Lavanya Pesala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to download current page from excel format using java or servlet or jsp
 
Nam Ha Minh
Ranch Hand
Posts: 515
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use JExcelApi or Apache POI
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "current page from excel format"? A web page? If so, what's the relationship to a spreadsheet file?
 
Lavanya Pesala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After retrieve data from database that page want to download it.Means current page or present page download in excel format.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no direct relationship between a web page and a spreadsheet - you will need to create the spreadsheet explicitly using one of the libraries Nam Ha Minh has suggested. My choice would be Apache POI. Once you have created the file on the server, you can stream it to the browser.
 
Lavanya Pesala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am new to java.i have idea about poi jar file.but how to write code for downloading.means after retrieve data from data base. displaying all data from data base in
browser what ever displaying in page.download in excel format.can any one have sample code send me.Thanks for advances.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, that's not how this site works. People will not write the code for you, but they will help you write it yourself. Since you're a beginner, break the task into pieces and tackle those separately: 1) retrieve the data from the DB, 2) create a web page, 3) put a link on the web page for downloading the spreadsheet, 4) create the spreadsheet on the server, 5) stream the file to the browser.
 
Lavanya Pesala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i done upto 1.retrive data from databse.
and step number 3 .
after that i don't know how to create 4) create the spreadsheet on the server, 5) stream the file to the browser.

create the spreadsheet on the server means create excel sheet.can have any sample code is there send me. or any related to code link will be there send me.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The POI site has tons of example. Start reading at http://poi.apache.org/spreadsheet/index.html with the "Quick Guide" and the "HOWTO".

See http://www.coderanch.com/how-to/java/CodeBarnSimpleStream for an example of how to stream something to the browser via a servlet.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!