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

Export to excel with template

1 Answer 148 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Elver Emilio Cano Cardona
Top achievements
Rank 1
Elver Emilio Cano Cardona asked on 07 Jul 2010, 02:11 PM

Hello.. how are you..

i have the next scene.. i have a grid nest into the other grid i am using the tools to export of telerik.. its a example:

 

public

 

void Export(String sFilepath, RadGridView grvExportExcel)

 

{

 

ExportToExcelML exporter = new ExportToExcelML(grvExportExcel);

 

exporter.SummariesExportOption =

SummariesOption.ExportAll;

 

exporter.RunExport(sFilepath);

 

}

but its doesn't work .. when i run this function its make the file succesfully but only export the primary grid and the template not...
i need export all information of the grid... if somebody can help me.. i will pleasure.. for your help.

 

 

public void Export(String sFilepath, GridViewTemplate grvtExportExcel)

 

{

 

RadGridView rgvGrid = new RadGridView();

 

 

foreach (GridViewDataColumn c in grvtExportExcel.Columns)

 

{

rgvGrid.Columns.Add(c);

}

 

foreach (GridViewDataRowInfo d in grvtExportExcel.Rows)

 

{

rgvGrid.Rows.AddNew(d);

}

ExportToExcelML exporter = new ExportToExcelML(rgvGrid);

 

exporter.SummariesExportOption = SummariesOption.ExportAll;

 

exporter.RunExport(sFilepath);

}

 

}

but its doesn't work neither....

regards...
thanks for your help.

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 13 Jul 2010, 10:30 AM
Hello Elver Emilio Cano Cardona,

Thank you for writing.

Actually RadGridView's exporting methods do not support exporting hierarchy data. The grid always exports the content of the MasterGridView template. The main reason for this is that MS Excel does not support hierarchical data by itself.

We are nevertheless considering the implementation of exporting hierarchical data (in a flat structure) in a future release. Any suggestions on how you think the hierarchical data should be represented in Excel will be highly appreciated.

 
Sincerely yours,
Martin Vasilev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Elver Emilio Cano Cardona
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or