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. General Programming
  3. C#
  4. working with excel

working with excel

Scheduled Pinned Locked Moved C#
csharptutorial
5 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.
  • K Offline
    K Offline
    kingmas
    wrote on last edited by
    #1

    hi i need an example for creating a report in excel file from C# code thanks

    A 1 Reply Last reply
    0
    • K kingmas

      hi i need an example for creating a report in excel file from C# code thanks

      A Offline
      A Offline
      albCode
      wrote on last edited by
      #2

      http://www.c-sharpcorner.com/winforms/ExcelReadMG.asp[^] _____________________ Proud to be Albanian _____________________

      K 1 Reply Last reply
      0
      • A albCode

        http://www.c-sharpcorner.com/winforms/ExcelReadMG.asp[^] _____________________ Proud to be Albanian _____________________

        K Offline
        K Offline
        kingmas
        wrote on last edited by
        #3

        Hi I need also to create a graph(in Excel) from the data i have in C# code thanks

        P 1 Reply Last reply
        0
        • K kingmas

          Hi I need also to create a graph(in Excel) from the data i have in C# code thanks

          P Offline
          P Offline
          prrusa
          wrote on last edited by
          #4

          Where are you getting errors? Post the code you tried.

          M 1 Reply Last reply
          0
          • P prrusa

            Where are you getting errors? Post the code you tried.

            M Offline
            M Offline
            mcljava
            wrote on last edited by
            #5

            Errors and Excel, I recently have resolved a major pain when using OLE DB. If you are using the Excel Object Model then ignore this. Basically I was glad to finally discover some info buried on MSDN that helped me resovle reading (importing) data from Excel via OLE DB. Two things: In your Connection String Extended Options there is a setting called IMEX. It can have one of the following values: 0 = Export 1 = Import 2 = Update Thus, let's say you want to read an Excel file that has a few questionable cells (i.e. IMEX=1). Well without some further intervenion in the Registry, OLE DB still may not fetch the records properly because it uses the first 8 cells in the column to guess the data type. Easy to fix but you have to know about this to make it work. Nip into REGEDIT and goto to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel Then you have to tweak the value of a setting called no less than TypeGuessRows. You can choose a value that makes sense in your context, say it might take 100 cells to determine the type in your estimation. Then here it's definitely OK to try 100 as the value. This is an execise in tuning verus trial and error. If you have a humongous spreadsheet, you can use 0 which causes the Type Guess to scan up to 16,000 rows. That's a tad excessive for most apps, so like I said trial and error. BUT Wait there's more.... when you finally go to deploy your application MAKE SURE your MSI updates the Registry! Mike Luster CTI/IVR/Telephony SME

            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