I am creating an Excel spreadsheet from and ASP.Net web page query. One of my fields is for a social security number, datatype varchar. The problem is that when Excel reads in the data it defaults the social security number field to numeric which causes leading zeros to be truncated. I need a way to preformat the Excel column to text to preserve the data.
I have tried to pass the data to Excel via xml and an xsl stylesheet but can't seem to get the stylesheet to work correctly.
Does anyone have any experience with this or know of another way to preformat Excel?