Click here to Skip to main content
15,903,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am facing a problem while formatting the cell value during excel export from a C#.Net 2.0 application form.

I have a column named as "URC Code", It's a user defined code which the user can enter in the master for an Item or Component (other than the code with which it is defined) in order to keep a track of the items and components according to their defined code.

The code can be anything for e.g. it can be a word like 'abcd','xyz'; it can be a a number (upto 13 digit) like '0331053110065', a decimal value like '13.42'.

When i am keeping the cell NumberFormat value to '0' then it shows the correct value for '0331053110065' but a wrong value for '13.42' i.e., '13' (truncating the decimal value) and when i am keeping the NumberFormat value to '0.00' then it shows the correct value for '13.42' and wrong value for '0331053110065' i.e., '3.31053E+11'.

My problem is that when i export the items or component to excel, what formatting should i give to 'URC Code' column so that the data in the cell is visible to user correctly.
Posted
Updated 15-Jul-10 0:04am
v3

1 solution

It sounds like you need to parse the data and set the theme cell by cell, according to the nature of the data.
 
Share this answer
 
Comments
Varun Sareen 15-Jul-10 7:19am    
Thanks Dear I did it. :-)
Varun Sareen 15-Jul-10 7:35am    
Reason for my vote of 5
Well done Christian

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900