This is a migrated thread and some comments may be shown as answers.

Export Mastertable and Detailtables

2 Answers 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 16 Feb 2009, 06:28 PM
Hello,

I am not being able to export both mastertable and detailtables. I can only export mastertable.. and no child records :(
I was able to do this in radgrid version 5.0.0.0 !

Private Sub dgVisits_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles dgVisits.ItemCommand
        If e.CommandName = "ExportXLS" Then
                dgVisits.ExportSettings.IgnorePaging = True
            dgVisits.ExportSettings.OpenInNewWindow = True
            dgVisits.ExportSettings.ExportOnlyData = True

            dgVisits.MasterTableView.ExportToExcel()
        end if
  End Sub

Thanks in advance

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 17 Feb 2009, 04:46 AM
Hi David,

Try the following code snippet to export the MasterTable as well as DetailTable of a RadGrid.

VB:
Private Sub dgVisits_ItemCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles dgVisits.ItemCommand  
   If e.CommandName = "ExportXLS" Then 
    dgVisits.MasterTableView.HierarchyDefaultExpanded = True   
    dgVisits.ExportSettings.IgnorePaging = True 
    dgVisits.ExportSettings.OpenInNewWindow = True 
    dgVisits.ExportSettings.ExportOnlyData = True 
    dgVisits.MasterTableView.ExportToExcel()  
   end if  
End Sub 

Thanks,
Princy.
0
David
Top achievements
Rank 1
answered on 17 Feb 2009, 11:13 AM
That did work :) thanks for the quick answer !
Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
David
Top achievements
Rank 1
Share this question
or