File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSP  data to CSV format conversion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP  data to CSV format conversion" Watch "JSP  data to CSV format conversion" New topic
Author

JSP data to CSV format conversion

prasanna kumar
Greenhorn

Joined: Jun 27, 2004
Posts: 12
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

Joined: Jan 10, 2002
Posts: 61766
    
  67

You'll have to emit actual Excel format. I do not believe that there is anything you can do with a CSV file.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42927
    
  68
Or you have to use Excels Import menu, which let's you specify which columns are text and which are numbers.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

In Excel, don't you see the actual number if you make the column wider?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP data to CSV format conversion