The official release of Ext.NET Mobile is now available. Ext.NET Mobile is an ASP.NET component framework for building Phone and Tablet specific mobile web applications. Read More

How to export GridPanel to the Excel?

  1. #1

    How to export GridPanel to the Excel?

    Hi,guys,

    How to export GridPanel to the Excel?

    best regards,
    Jachnicky
  2. #2

    RE: How to export GridPanel to the Excel?

    Move to "Help" forum from "Open Discussions"

    Geoffrey McGill
    Founder & CEO
  3. #3

    RE: How to export GridPanel to the Excel?

    If you want to retain the styling and formatting of the GridPanel, it will be hard. However, if you are only looking for a data dump export, you can easily export your datasource as a csv file to Excel.

        Public Shared Sub ExportDataTable(ByVal aDataTable As DataTable, ByVal aWriter As IO.TextWriter)
            Dim colCount As Integer = aDataTable.Columns.Count
    
            'add column headers
            For Each column As DataColumn In aDataTable.Columns
                aWriter.Write(column.Caption & ",")
            Next
            aWriter.WriteLine()
    
            'add cells
            For Each row As DataRow In aDataTable.Rows
                For i As Integer = 0 To colCount - 1
                    aWriter.Write(row(i).ToString.Replace(",", String.Empty) & ",")
                Next
                aWriter.WriteLine()
            Next
    
        End Sub
  4. #4

    RE: How to export GridPanel to the Excel?

    Hi jachnicky,

    Exporting to Excel is something I'm really interested in building into the client-side API, although timeline to implement has not been set. 


    The following forum post might be helpful, see http://forums.ext.net/showthread.php...=3031-7-1.aspx


    Geoffrey McGill
    Founder & CEO

Similar Threads

  1. Export to Excel
    By JonC in forum 1.x Help
    Replies: 9
    Last Post: Nov 13, 2012, 4:59 AM
  2. [CLOSED] Gridpanel export Excel HeaderText
    By CPA1158139 in forum 1.x Premium Help
    Replies: 1
    Last Post: Jun 10, 2012, 9:36 AM
  3. Replies: 5
    Last Post: May 23, 2011, 12:13 PM
  4. Replies: 2
    Last Post: May 22, 2011, 1:12 AM
  5. [CLOSED] Export Data To Excel in Remote Paging GridPanel
    By pdcase in forum 1.x Premium Help
    Replies: 3
    Last Post: Oct 11, 2010, 8:49 PM

Posting Permissions

Subscribe now to get the latest Ext.NET happenings in our newsletter.