Hi,guys,
How to export GridPanel to the Excel?
best regards,
Jachnicky
Printable View
Hi,guys,
How to export GridPanel to the Excel?
best regards,
Jachnicky
Move to "Help" forum from "Open Discussions"
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
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