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. ASP.NET
  4. Cell Format in excel. [modified]

Cell Format in excel. [modified]

Scheduled Pinned Locked Moved ASP.NET
csharptutorial
4 Posts 4 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.
  • D Offline
    D Offline
    dayakar_dn
    wrote on last edited by
    #1

    Hi, I am exporting some values into excelsheet. But when i open the excelsheet that time one column is showing some junk data but if i change the format of the cell from the excel then it is showing the correct data. I implemented export to excel using c# language. Any idea, how to set the cell format or any other way to show the data correctly with out changing the cell format from the excel. Thanks In Advance for better solution.

    modified on Wednesday, December 2, 2009 6:55 AM

    D A G 3 Replies Last reply
    0
    • D dayakar_dn

      Hi, I am exporting some values into excelsheet. But when i open the excelsheet that time one column is showing some junk data but if i change the format of the cell from the excel then it is showing the correct data. I implemented export to excel using c# language. Any idea, how to set the cell format or any other way to show the data correctly with out changing the cell format from the excel. Thanks In Advance for better solution.

      modified on Wednesday, December 2, 2009 6:55 AM

      D Offline
      D Offline
      Dinesh Mani
      wrote on last edited by
      #2

      Assuming you are using excel objects to generate the excel file, you can use the "NumberFormat" property of the desired cell to what ever format you want. To know what format text to apply, just open an excel sheet, start recording a macro, and set the desired format. You can get the format string from the macro code.

      1 Reply Last reply
      0
      • D dayakar_dn

        Hi, I am exporting some values into excelsheet. But when i open the excelsheet that time one column is showing some junk data but if i change the format of the cell from the excel then it is showing the correct data. I implemented export to excel using c# language. Any idea, how to set the cell format or any other way to show the data correctly with out changing the cell format from the excel. Thanks In Advance for better solution.

        modified on Wednesday, December 2, 2009 6:55 AM

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        Junk character means is it something with #### ? If this is so, it is because the whole data cant be shown because of insufficient space. It is normal and dont worry, the data is correctly there. If this is not the case, I think there is some problem. I need to know how are you exporting data to excel then. Is it using OleDb or InterOp ? :rose:

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->** Simplify Code Using NDepend
        Basics of Bing Search API using .NET
        Microsoft Bing MAP using Javascript

        1 Reply Last reply
        0
        • D dayakar_dn

          Hi, I am exporting some values into excelsheet. But when i open the excelsheet that time one column is showing some junk data but if i change the format of the cell from the excel then it is showing the correct data. I implemented export to excel using c# language. Any idea, how to set the cell format or any other way to show the data correctly with out changing the cell format from the excel. Thanks In Advance for better solution.

          modified on Wednesday, December 2, 2009 6:55 AM

          G Offline
          G Offline
          Gamzun
          wrote on last edited by
          #4

          how you're exporting to excel?

          Please don't forget to mark 'Good Answer', if you find it really a good one! Kashif

          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