Solved

Data not getting properly displayed in the Excel file

Posted on 2006-06-16
9
238 Views
Last Modified: 2010-03-31
I have  a java program which  takes  Arraylist of objects and converts it into a Excel file. But when one of the values in the arraylist is "0736", the excel file displays as 736. But my business analyst is syaing it should display as 0736 to satisfy the requirements.

Thanks
Hari
0
Comment
Question by:SubhaBabu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 16923322
Why not enter it as a string?
0
 
LVL 2

Author Comment

by:SubhaBabu
ID: 16923407
It is already a string.

Thanks
Subha
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 32 total points
ID: 16923424
If it's taken away the zero it must *think* it's a number. Why would it otherwise?
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
LVL 26

Assisted Solution

by:ksivananth
ksivananth earned 31 total points
ID: 16923616
check if you can specify the cell property as text while converting to excel
0
 
LVL 5

Assisted Solution

by:tbboyett
tbboyett earned 31 total points
ID: 16923863
What are you using to export the data as an excel file?  Are you using jExcel, exporting as a csv file, or something else?

If you are using jExcel you could look at the API at:

TEXT - Static variable in class jxl.write.NumberFormats
Forces numbers to be interpreted as text

You can download it here http://www.andykhan.com/jexcelapi/download.html
0
 
LVL 5

Expert Comment

by:tbboyett
ID: 16923877
By the way, the problem is most likely because the default CellFormat is of type "General" and needs to be set to "Text" as ksivananth and CEHJ mentioned
0
 
LVL 92

Assisted Solution

by:objects
objects earned 31 total points
ID: 16924166
try adding ' to front of string. eg. '0736
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
tomcat startup error 5 162
pagenation logic how it is working in my code 1 80
jboss 7.1 start up error 1 82
Eclipse Java import and method not resolved 4 124
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This video teaches viewers about errors in exception handling.
Suggested Courses

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question