Results 1 to 4 of 4

Thread: How to export GridPanel to the Excel?

  1. #1
    Member
    Join Date
    Nov 2008
    Location
    Posts
    45

    How to export GridPanel to the Excel?

    Hi,guys,

    How to export GridPanel to the Excel?

    best regards,
    Jachnicky

  2. #2
    Ext.NET - Dev Team geoffrey.mcgill's Avatar
    Join Date
    Jan 2008
    Location
    Canada
    Posts
    8,661

    RE: How to export GridPanel to the Excel?

    Move to "Help" forum from "Open Discussions"

    Geoffrey McGill
    Ext.NET, Inc.
    Founder, and Dev Team

    Ext.NET Examples | Ext.NET API Docs | ExtJS API Docs | @extnet | Jobs

  3. #3
    Premium Member
    Join Date
    Apr 2008
    Location
    Posts
    1,328

    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.

    Code:
        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
    Ext.NET - Dev Team geoffrey.mcgill's Avatar
    Join Date
    Jan 2008
    Location
    Canada
    Posts
    8,661

    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
    Ext.NET, Inc.
    Founder, and Dev Team

    Ext.NET Examples | Ext.NET API Docs | ExtJS API Docs | @extnet | Jobs

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