Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Export to excel - formatting problem

Export to excel - formatting problem

Scheduled Pinned Locked Moved Web Development
htmlhelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paddy Boyd
    wrote on last edited by
    #1

    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...

    H 1 Reply Last reply
    0
    • P Paddy Boyd

      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...

      H Offline
      H Offline
      Harini N K
      wrote on last edited by
      #2

      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 :)

      P 1 Reply Last reply
      0
      • H Harini N K

        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 :)

        P Offline
        P Offline
        Paddy Boyd
        wrote on last edited by
        #3

        Ok - converting the output to nvarchar solved your problem? I'll give that a go...

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups