Export to excel - formatting problem
-
Hi, We've some code that spits out an html table from our application and opens it within excel. One of our clients has recently been having a problem with date formats (operations in different regions of the world). We changed our code to output all the dates in the format dd mmm yyyy (e.g. 31 Mar 2006), they've come back with a problem that our report is fine for the first couple of hundred lines in excel, the date columns are correctly formatted as dates, but after that line, all the date formatting is lost, and just displayed as 'text'. It's also impossible to change the cell format back to date... (the line the format is lost on has identical dates in many cases to the previous line...) Anybody ever seen anything like this? I'm stumped...
-
Hi, We've some code that spits out an html table from our application and opens it within excel. One of our clients has recently been having a problem with date formats (operations in different regions of the world). We changed our code to output all the dates in the format dd mmm yyyy (e.g. 31 Mar 2006), they've come back with a problem that our report is fine for the first couple of hundred lines in excel, the date columns are correctly formatted as dates, but after that line, all the date formatting is lost, and just displayed as 'text'. It's also impossible to change the cell format back to date... (the line the format is lost on has identical dates in many cases to the previous line...) Anybody ever seen anything like this? I'm stumped...
Hi Mine too had the same problem.... Are you retrieving data from SQL Server 2000?? It is better to convert date fields to nvarchar using SQL convert() function.
Ex. convert(nvarchar(12), DateTimeField,101)
Rate this message. Thank you. Harini :)
-
Hi Mine too had the same problem.... Are you retrieving data from SQL Server 2000?? It is better to convert date fields to nvarchar using SQL convert() function.
Ex. convert(nvarchar(12), DateTimeField,101)
Rate this message. Thank you. Harini :)
Ok - converting the output to nvarchar solved your problem? I'll give that a go...