• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

export to excel

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic