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

Getting Null Exception while exporting detailstable data

4 Answers 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bharat
Top achievements
Rank 1
Bharat asked on 27 Jan 2014, 10:41 AM
Hi,

I am trying to export the inner radgrid details in ExcelML format, but I am getting null exception after the process.
While I am able to export in other format.

Please refer to attached screenshot

Thanks
Bharat

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 27 Jan 2014, 12:01 PM
Hi Bharat,

The error is caused by the fact that you may be using simple data binding to populate the RadGrid. In order to use export to ExcelML, you should bind the grid control through AdvancedDataBinding or declaratively by DataSourceControl, as stated in the documentation here.

Thanks,
Princy
0
Bharat
Top achievements
Rank 1
answered on 27 Jan 2014, 12:16 PM
Hi Princy 

I am using HTML format, but it is showing excel sheet  as white paper not as formatted as Excel,
Can you point me how to change this behavior if it's possible in Telerik with HTML format

Thanks 
Bharat
0
Bharat
Top achievements
Rank 1
answered on 27 Jan 2014, 01:07 PM
Hi Princy,

Can we export all the inner details table of multiple node in a single report.

Thanks
Bharat 
0
Kostadin
Telerik team
answered on 30 Jan 2014, 09:38 AM
Hello Bharat,

In order to export a formatted table you have to set ExportOnlyData to true. Regards your second question you could either show the Export to excel button on each detail table or find the GridTableView into your code behind and call ExportToExcel method.
Mark-up:
<DetailTables>
    <telerik:GridTableView CommandItemDisplay="Top">
        <CommandItemSettings ShowExportToExcelButton="true" />
        <Columns>
          ............
        </Columns>
    </telerik:GridTableView>
</DetailTables>
C#:
RadGrid1.MasterTableView.DetailTables[0].ExportToExcel();

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 UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Bharat
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Bharat
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or