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

Export to Excel for grouped data in radgrid

1 Answer 121 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
tuba
Top achievements
Rank 1
tuba asked on 18 Feb 2016, 07:08 AM

Hi,

I have a radgrid which groups data according to Name. So, John will have all his data displayed and then greg and so on. But when I use to export to excel, it always exports the last group.

Any ideas on this would be helpful. 

I was also not able to find any demos for exporting grouped data.

 

I have used the following export settings:

           string alternateText = "ExcelML";
            this.radGridBusinessGoalList.ExportSettings.Excel.Format =               (Telerik.Web.UI.GridExcelExportFormat)Enum.Parse(typeof(Telerik.Web.UI.GridExcelExportFormat), alternateText);
            this.radGridBusinessGoalList.ExportSettings.ExportOnlyData = true;
            this.radGridBusinessGoalList.ExportSettings.IgnorePaging = true;
            this.radGridBusinessGoalList.ExportSettings.OpenInNewWindow = true;

 

Thanks,

TM

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 23 Feb 2016, 07:05 AM
Hi,

Please make sure that you are not using DataBind() to bind the grid. Performing complex grid operations such as Inserting, Deleting, Updating, Hierarchy relations, Grouping, Exporting, Paging, Sorting, Filtering, etc. require accommodating appropriate database operations.  Therefore, we suggest you to avoid Simple Databinding and strongly recommend the use of more advanced databinding methods, which automatically handle the aforementioned functions:
Declarative DataSource
Programmatic Data Binding


Also, you can temporarily remove the IgnorePaging and change the Format, because ExcelML has some specifics with Grouping:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/exporting/export-formats/excelml-export/excelml-basics


Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
tuba
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or