Results 1 to 3 of 3
Thread: setContentType() help
- 10-09-2008, 08:25 PM #1
Member
- Join Date
- Oct 2008
- Posts
- 2
- Rep Power
- 0
setContentType() help
hai
am developing a web application named as Defect tracking tool.
am using servlet.
i have placed a link in my page. when i click it it should fetch datas from the database and then generate a .xls file(ms excel) to show the fetched datas.
the fetched datas frm the table should be in order as it is shown in the table.
i have used setContentType("application\vnd-ms-excel") to produce the responce as an .xls file.
the problem is the output is not in the order as the table format.
it looks like one below
empNo
empName
empSal
101
xxx
15500
102
yyy
22983
but i need the output to be like this
empNo empName empSal
101 xxx 15500
102 yyy 22983
to be displayed in the xls file.
plz help me
- 10-09-2008, 09:30 PM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
And how did you produce the output?
Simply setting the content type is not enough. You need to actually produce that type of content. Setting the type to excel, but simply producing text is not going to work.
Google for "Andy Khan JExcel" for an API that will let you actually produce an excel document.
- 10-09-2008, 11:18 PM #3
Similar Threads
-
response.setContentType
By bbq in forum Java ServletReplies: 3Last Post: 01-17-2012, 05:37 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks