?
Solved

Data not getting properly displayed in the Excel file

Posted on 2006-06-16
9
Medium Priority
?
248 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 128 total points
ID: 16923424
If it's taken away the zero it must *think* it's a number. Why would it otherwise?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 26

Assisted Solution

by:ksivananth
ksivananth earned 124 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 124 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 124 total points
ID: 16924166
try adding ' to front of string. eg. '0736
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

762 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