• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

JSP data to CSV format conversion

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67693
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43045
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 27526
88
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Excel, don't you see the actual number if you make the column wider?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic