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

Export to Word/Excel Problem

1 Answer 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Santhosh
Top achievements
Rank 1
Santhosh asked on 18 Mar 2009, 04:36 PM
hi friends,

Export option is not working for my grid.

i am unable to find where i was done the mistake

can anybody help me.

my code is 

<

telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="100%" Width="100%">

 

 

<telerik:RadToolBar ID="RadToolBar1" Runat="server" Skin="Black" Width="100%" OnClientButtonClicked="ToolBarMenuClicked" OnButtonClick="RadToolBar1_ButtonClick">

 

 

<CollapseAnimation Duration="200" Type="OutQuint" />

 

 

<Items>

 

 

<telerik:RadToolBarDropDown runat="server" Text="New">

 

 

<Buttons>

 

 

<telerik:RadToolBarButton runat="server" CommandName="UnRequestPage"

 

 

ImageUrl="~/Images/Sr_New.gif" Text="Submit Unrequested Report" Width="160px">

 

 

</telerik:RadToolBarButton>

 

 

<telerik:RadToolBarButton runat="server" CommandName="PrintGrid"

 

 

ImageUrl="~/Images/PWAPrint.gif" Text="Print Grid" Width="160px">

 

 

</telerik:RadToolBarButton>

 

 

<telerik:RadToolBarButton runat="server" CommandName="ExportToExcel"

 

 

ImageUrl="~/Images/PWAExcel.gif" Text="Export To Excel" Width="160px">

 

 

</telerik:RadToolBarButton>

 

 

</Buttons>

 

 

</telerik:RadToolBarDropDown>

 

 

<telerik:RadToolBarDropDown runat="server" Text="Actions">

 

 

<Buttons>

 

 

<telerik:RadToolBarButton runat="server" CommandName="SR_Archive"

 

 

Text="Status Report: Archive">

 

 

</telerik:RadToolBarButton>

 

 

</Buttons>

 

 

</telerik:RadToolBarDropDown>

 

 

</Items>

 

 

</telerik:RadToolBar>

 

 

<br />

 

 

<telerik:RadGrid ID="RadGridRequestLists"

 

 

runat="server" AllowPaging="True" AllowSorting="True"

 

 

onneeddatasource="RadGridRequestLists_NeedDataSource"

 

 

AutoGenerateColumns="False">

 

 

<PagerStyle Mode="NextPrevNumericAndAdvanced" />

 

 

<HeaderContextMenu>

 

 

<CollapseAnimation Duration="200" Type="OutQuint" />

 

 

</HeaderContextMenu>

 

 

<ClientSettings >

 

 

<Selecting AllowRowSelect="True" />

 

 

<ClientEvents OnRowSelected="RowSelected" />

 

 

<Scrolling AllowScroll="True" />

 

 

</ClientSettings>

 

 

<ExportSettings OpenInNewWindow="true">

 

 

</ExportSettings>

 

 

<MasterTableView CommandItemDisplay="Top" Width="99.9%">

 

 

<CommandItemTemplate>

 

 

<table>

 

 

<tr>

 

 

<td>

 

 

&nbsp;</td>

 

 

<td>

 

 

<img alt="" src="Images/Sr_New.gif" /></td>

 

 

<td>

 

 

<a href="javascript:void(0)" onclick="GotoNewRequestPage()">Submit Unrequest Report</a></td>

 

 

</tr>

 

 

</table>

 

 

</CommandItemTemplate>

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="Title" HeaderText="Title" UniqueName="Title" >

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Due To" HeaderText="Due To" UniqueName="Due To">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Due On" HeaderText="Due On" UniqueName="Due On">

 

 

</telerik:GridBoundColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

<FilterMenu>

 

 

<CollapseAnimation Duration="200" Type="OutQuint" />

 

 

</FilterMenu>

 

 

</telerik:RadGrid>

 

 

</telerik:RadAjaxPanel>

 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Mar 2009, 04:12 AM
Hi,

The exporting feature of the control work with regular postbacks only. The reason is the grid prepares additional information when performing export operation (available on postback). When the action is performed through asynchronous requests, this information can not be passed through the XMLHttpObject - that is why the communication between the browser and the server fails.
 You may get more information regarding this from the followinh help article.
Export from ajaxified grid

Shinu
Tags
Grid
Asked by
Santhosh
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or