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

[Solved] Export to Excel in Hireachy Grid

4 Answers 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Asra
Top achievements
Rank 1
Asra asked on 13 Jun 2009, 01:20 PM
Hi All,
           I have two levels of hireachy  Grid whose data iam trying to ExportToExcel . Iam using the code as:

 

this.radMainGrid.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML; 
in order to apply the styles to the Grid.
for the above code line it is throwing me error as  Object Referecnce not Set to Instance of an object.
Here we are using Trial version of the Grid.

 


 this.radMainGrid.ExportSettings.OpenInNewWindow = true;  
            this.radMainGrid.ExportSettings.ExportOnlyData = true;  
            this.radMainGrid.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML;  
            this.radMainGrid.MasterTableView.ExportToExcel(); 

Can any one pls let me why it is throwing me this error.

Pls let me know its very urgent.

Regards,
Asra.

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 14 Jun 2009, 11:26 PM
Hello Asra,

I'm afraid the provided code is not enough to provide to-the-point answer for you. Could you please attach a runnable version of your project to a formal support ticket? This way we will be able to debug it locally.

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Qaja Mohiddin
Top achievements
Rank 1
answered on 17 Jun 2009, 06:35 AM
Hi,

Iam using the same code that is given in the demo Hireachy with Templates. That Grid iam trying to export to excel  and export to PDF.
For export to excel if i use that property this.radMainGrid.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML; 
 it is throwing error as Object not Reference.

For PDF only first level of data is exported even though the Grid is expanded.

Can you pls how to do this.

Its very urgent .

Regards
asra.
0
Asra
Top achievements
Rank 1
answered on 17 Jun 2009, 07:18 AM
Hi Daniel,


Iam using the same code that is given in the demo Hireachy with Templates. That Grid iam trying to export to excel  and export to PDF.
For export to excel if i use that property this.radMainGrid.ExportSettings.Excel.Format = Telerik.Web.UI.GridExcelExportFormat.ExcelML; 
 it is throwing error as Object not Reference.

For PDF only first level of data is exported even though the Grid is expanded.

Can you pls how to do this.

Its very urgent .

Regards
asra.
0
Daniel
Telerik team
answered on 17 Jun 2009, 08:21 AM
Hello Asra,

Although the PDF engine can handle nested RadGrids, I'm afraid that such complicated scenarios are not supported - there are TabStrip, DetailsView, Chart, nested Grids, nested table - all of these nested in template...

Regarding the ExcelML export - it retrieves the data from the datasource directly and therefore it don't support NestedViewTemplate.

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Asra
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Qaja Mohiddin
Top achievements
Rank 1
Asra
Top achievements
Rank 1
Share this question
or