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

Export to Excel not work

5 Answers 198 Views
Grid
This is a migrated thread and some comments may be shown as answers.
dominic
Top achievements
Rank 1
dominic asked on 15 Dec 2011, 04:17 AM
Every body, please help me.

 I made a (asp.net) UserControl ,  I drag a grid into the usercontrol and rendering this usercontrol in a asp.net page.
Now my question is: I want to export the data from the grid to Excel ,and I follow the instruction within grid help documnet. But I did not see any popup window after I click  the export button.
I use version: RadControls for ASP.NET AJAX Q1 2011
my code snippet here: 

        <MasterTableView Width="100%" CommandItemDisplay="Top">
            <PagerStyle Mode="NextPrevNumericAndAdvanced" />
            <CommandItemSettings ShowExportToExcelButton="true" />
        </MasterTableView>


5 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 15 Dec 2011, 05:28 AM
Hello Dominic,

Try setting the following.
aspx:
<ExportSettings ExportOnlyData="true" OpenInNewWindow="true" IgnorePaging="false" Excel-Format="Html"></ExportSettings>

-Shinu.
0
dominic
Top achievements
Rank 1
answered on 05 Jan 2012, 01:56 AM
Hello Shinu,
Thank you for your answer, but after I follow you setting, It's still not work.

there is not any popup window show.

Please see my attach image.
0
Timothy
Top achievements
Rank 1
answered on 05 Jan 2012, 03:42 AM
I had a similar problem and got around it by using a button external to the RadGrid and used the server side event to run ExportToExcel() command. The other problems I encountered were due to the AJAX settings. I had to on Page_Load run
         ScriptManager.GetCurrent(Page).RegisterPostBackControl(ExportIt);
and make sure that the parent page did not AJAXify the content holder of the user control.
0
Accepted
Shinu
Top achievements
Rank 2
answered on 05 Jan 2012, 05:14 AM
Hello Dominic,

The above mentioned settings worked as expected in my end. If you have ajaxified your RadGrid, the exporting feature of the control work with regular postbacks only. Check the following help documentation which explains more about this.
Export from Ajaxified Grid

-Shinu.
0
dominic
Top achievements
Rank 1
answered on 05 Jan 2012, 08:00 AM
Hello Shinu,
you solution is OK. Thank you very much.

It look like there is night in your place, good night!

And Welcome to China!

-Dominic
Tags
Grid
Asked by
dominic
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
dominic
Top achievements
Rank 1
Timothy
Top achievements
Rank 1
Share this question
or