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

Grid Export to Excel Biff Format Hierarchy and Selected items

1 Answer 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 02 Oct 2013, 07:38 PM
Hi,

I have 2 questions about Excel export.

1. I try to export info to Excel from a RadGrid with a MasterTable and  (1)DetailTable in ML format and exported all info but I can not exclude not items selected. 

2. I prefer change the Format ML to Biff but detailTable's info not export . 

Please, I  need help

aspx
<ExportSettings FileName="documentos_Recoger" HideStructureColumns="true" ExportOnlyData="true"<br>                                    IgnorePaging="true" OpenInNewWindow="true"><br>                                    <br>                                </ExportSettings>


C#
protected void ExcelButton_Click(Object sender, System.EventArgs e)
    {
foreach (GridDataItem item in RadGrid1.Items)
{
if (item.Selected == false)
{
item.Visible =
false;
}
}
RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
RadGrid1.MasterTableView.DetailTables[0].HierarchyDefaultExpanded = true;
RadGrid1.ExportSettings.ExportOnlyData = true;
RadGrid1.ExportSettings.OpenInNewWindow = true;
RadGrid1.MasterTableView.ExportToExcel();
}

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 07 Oct 2013, 10:56 AM
Hi Carlos,

As it is described in the following help article, Biff format does not support hierarchy export. You have to use one of the rest formats which are HTML or ExcelML. In order to export only the selected rows you have to check whether the current row is selected and if it is not you have to remove it from the Excel table. For your convenience I prepared a small sample and attached it to this thread.

Please give it a try and let me know if I could provide you any further assistance.

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Carlos
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or