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. export datagrid's data to Excel sheet (windows application)

export datagrid's data to Excel sheet (windows application)

Scheduled Pinned Locked Moved C#
csharpwinformshelptutorialquestion
7 Posts 6 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.
  • W Offline
    W Offline
    Walaza
    wrote on last edited by
    #1

    Hi,, I have a C#.net windows application with a datagridview.I need to export datagrid's data to Excel sheet. How to export from DatagridView to Excel Sheet in C# Windows Forms? Anybody has sample code in C#? Please Help!!!!!!

    Mvelo Walaza Developer Telkom SA

    G N B R D 5 Replies Last reply
    0
    • W Walaza

      Hi,, I have a C#.net windows application with a datagridview.I need to export datagrid's data to Excel sheet. How to export from DatagridView to Excel Sheet in C# Windows Forms? Anybody has sample code in C#? Please Help!!!!!!

      Mvelo Walaza Developer Telkom SA

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      Google not working for you? a simple search with your post's title points to many useful resources.

      Giorgi Dalakishvili #region signature my articles #endregion

      1 Reply Last reply
      0
      • W Walaza

        Hi,, I have a C#.net windows application with a datagridview.I need to export datagrid's data to Excel sheet. How to export from DatagridView to Excel Sheet in C# Windows Forms? Anybody has sample code in C#? Please Help!!!!!!

        Mvelo Walaza Developer Telkom SA

        N Offline
        N Offline
        Not Active
        wrote on last edited by
        #3

        You don't export the DtaGridView, you export the data that is used to construct the Grid. A simple, though not 1005 reliable, method would be to write the data to an xml (DataSet.WriteXml)file and change the extension to xls, or transform the xml. http://www.codeproject.com/KB/office/Excel_Export.aspx[^] Otherwise, you will need to create a Workbook instance and add the columns and rows to it.


        only two letters away from being an asset

        1 Reply Last reply
        0
        • W Walaza

          Hi,, I have a C#.net windows application with a datagridview.I need to export datagrid's data to Excel sheet. How to export from DatagridView to Excel Sheet in C# Windows Forms? Anybody has sample code in C#? Please Help!!!!!!

          Mvelo Walaza Developer Telkom SA

          B Offline
          B Offline
          buchstaben
          wrote on last edited by
          #4

          http://www.codeproject.com/script/Forums/View.aspx?fid=1649&msg=2468882[^]

          1 Reply Last reply
          0
          • W Walaza

            Hi,, I have a C#.net windows application with a datagridview.I need to export datagrid's data to Excel sheet. How to export from DatagridView to Excel Sheet in C# Windows Forms? Anybody has sample code in C#? Please Help!!!!!!

            Mvelo Walaza Developer Telkom SA

            R Offline
            R Offline
            Ravenet
            wrote on last edited by
            #5

            Hi Man Please check in this url www.csharp-corner.com thanks

            Cheers,Earn and Enjoy RRave MCTS,MCPD http://ravesoft.blogspot.com

            1 Reply Last reply
            0
            • W Walaza

              Hi,, I have a C#.net windows application with a datagridview.I need to export datagrid's data to Excel sheet. How to export from DatagridView to Excel Sheet in C# Windows Forms? Anybody has sample code in C#? Please Help!!!!!!

              Mvelo Walaza Developer Telkom SA

              D Offline
              D Offline
              dhans
              wrote on last edited by
              #6

              private void Exl_Click(object sender, System.Web.UI.ImageClickEventArgs e) { string strTitle = " any Name u give" + DateTime.Now; new DataGridExcelExporter(this.gridname , this.Page).Export(strTitle); }

              dhans

              W 1 Reply Last reply
              0
              • D dhans

                private void Exl_Click(object sender, System.Web.UI.ImageClickEventArgs e) { string strTitle = " any Name u give" + DateTime.Now; new DataGridExcelExporter(this.gridname , this.Page).Export(strTitle); }

                dhans

                W Offline
                W Offline
                Walaza
                wrote on last edited by
                #7

                I am doing a Windows application. Is there code for a Windows application to do this?

                Mvelo Walaza Developer Telkom SA

                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