This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes export to excel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "export to excel" Watch "export to excel" New topic
Author

export to excel

anil bisht
Ranch Hand

Joined: Nov 04, 2000
Posts: 81
Hi,
I am using Export to excel in my servlets. where in the user will be shown some details in the Excel format. I get data from the database and append it with "\n" for an new line and "\t" for a new column.
then i simply use the following to display the results in the excel sheet on hte browser.
objHttpServletResponse.setContentType(STR_MIME_EXCEL);
OutputStream output = objHttpServletResponse.getOutputStream();
output.write((byte[]) pstrFormatedData .getBytes());
Where pstrFormatedData is the data from the database after adding with "\n" and "\t"
It works fine, but if there is some data in the database which alrady have "\n" or "\t", then i have problem. As this data should be displayd in a single column, but this data is displayd in multiple columns. Is there any way out.
Regards
Anil
 
 
subject: export to excel
 
Similar Threads
Saving data to Excel files
convert mysql data into excel format
Throws EOFException during insertion in db file, and reading back data
Write Data to Excel
creating excel file by servlet