Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP data to CSV format conversion

 
prasanna kumar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends

I'm converting a report which is in jsp file to a Comma separated value format.
whats happenening is when the field is a String which has numeric values like "123456678979708" the csv format treats it as a number and the data is printed in the excel sheet in the scientific notation. like 1.2 E10. IS there anyway to specify it as a plain text so that the number prints as it is.
I tried several approaches
1) I tried inserting a space before the number in the jsp so that the excel will consider it as a plain string
2) I tried putting the data within quotes in the jsp --- did not work either
3) I tried putting a '/' character .. still did not work

Is there any work around for this??
thanks

arun
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64984
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll have to emit actual Excel format. I do not believe that there is anything you can do with a CSV file.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you have to use Excels Import menu, which let's you specify which columns are text and which are numbers.
 
Paul Clapham
Sheriff
Posts: 21149
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Excel, don't you see the actual number if you make the column wider?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic