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

[Solved] Problems with Export To Excel

2 Answers 145 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ban
Top achievements
Rank 1
Ban asked on 17 Aug 2009, 09:20 AM

Hi,
I used RadGrid Export to Excel befor and it was working very good but this time I do not know why it dose not work, My Grid is a hierarchy model and both the parent and child grid DataSourse is binded with DataTable by code, and the format I used in exporting is "ExcelML". So is that the reason why it dose not work !!!
Please Help me and please as soon as possible.

Thanks
Ban

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 Aug 2009, 10:55 AM
Hello Ban,

The ExcelML Excel format works only with ExportOnlyData set to true. So make sure that you have set it to true. I tried the following code and it works as expaected, check out for any differences with your code:
c#:
protected void Button1_Click(object sender, EventArgs e) 
    { 
        RadGrid1.ExportSettings.ExportOnlyData = true
        RadGrid1.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML; 
        RadGrid1.MasterTableView.HierarchyDefaultExpanded = true
        RadGrid1.Rebind(); 
        RadGrid1.MasterTableView.ExportToExcel(); 
    } 

Thanks
Princy.
0
Ban
Top achievements
Rank 1
answered on 17 Aug 2009, 11:21 AM
 Hi Princy,
Thanks for your replay, I already made ExportOnlyData toTrue and I face same problem and I try your code and same problem I got,
but as I said that my RadGrid is hierarchy model and my data sourse is DataTable binded to the Grid ( the Parent and Child) in code behind, so it is that the problem !!!???
Pleeeeease help me I need it so much

Thanks
Ban
Tags
Grid
Asked by
Ban
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Ban
Top achievements
Rank 1
Share this question
or