Home > ASP Development > 2/2/2 need to show in Excel From Asp.net

2/2/2 need to show in Excel From Asp.net



HI,



I am trying to show my data that is in the form of

2/2/2

or

1/1/12



I know how to transfer data from ASp.net to Excel. but the problem i am currently facing is that when i pass this kind of data to the excel. it changes it to a date.

i.e



if i want to show 2/2/2 it will appear like 2/2/2000 in Excel



I am using

Response.ContentType = "application/vnd.ms-excel"



to show data in excel.



Can any body help me out.





Regards,



QasimRaza

    
Guest


Have you tried putting quotes around it?

Was this answer helpful ? Yes No   
Guest


good point Elija.
Otherwise put another meta header. That will work probably.

Was this answer helpful ? Yes No   
Guest


utf-8 or something like that

Was this answer helpful ? Yes No   
Guest


Hi,



I got the required solution my self so thought to share with you all





While some one is going to bind such type of data where one feel that excel will change it to some of the default formate. we can handle this situation by making it a formula when binding our data with the Grid



so in my cast



"= ""2/2/2"""



will show

2/2/2

in the excel column.





While in AsP

Response.Buffer= True



will also fullfill the purpose.







Kind Regards,



QasimRaza

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved