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

Excel Export Exporing Only First Page

1 Answer 172 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Felipe Saldana
Top achievements
Rank 1
Felipe Saldana asked on 08 Sep 2010, 12:47 AM
I have followed this sample and it seems to work fine.

It looks to me like I followed the example but my code will only export the first page of the data and not all the records in the table.

protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
    if (e.Argument == "exportCsv")
    {
        exportCsvActivity();
    }
    else if (e.Argument == "exportExcel")
    {
        exportExcelActivity();
    }
     
}
 
protected void exportExcelActivity()
{
    ConfigureExport();
    this.gridActivity.MasterTableView.ExportToExcel();
}
 
public void ConfigureExport()
{
    this.gridActivity.ExportSettings.ExportOnlyData = false;
    this.gridActivity.ExportSettings.IgnorePaging = true;
    this.gridActivity.ExportSettings.OpenInNewWindow = false;

    this.gridActivity.MasterTableView.GetColumn("chkTemplate").Visible = false;
    this.gridActivity.MasterTableView.GetColumn("messageIndex").Visible = false;

}
function RadAjaxManager1_OnRequestStart(ajaxManager, eventArgs) {
 
    if (eventArgs.EventArgument == "exportCsv" || eventArgs.EventArgument == "exportExcel") {
        eventArgs.EnableAjax = false;
    }
     
 
}
 
function exportCsv()
{
     $find("<%= this.RadAjaxManager1.ClientID %>").ajaxRequest("exportCsv");
}
 
function exportExcel()
{
     $find("<%= this.RadAjaxManager1.ClientID %>").ajaxRequest("exportExcel");
}


       
<asp:LinkButton ID="btnExportExcel" runat="Server" Text="Excel Export" CommandName="exportExcel" CommandArgument="exportExcel" CssClass="subPageLinks" OnClientClick="exportExcel(); return false;" ></asp:LinkButton>


Thanks!

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 08 Sep 2010, 08:44 AM
Hello Felipe,

The code is working on my end when i am using AdvancedDataBinding. I guess you are using Simple Data Binding. If that the case I suggest you to use AdvancedDataBinding (using NeedDataSource event) to get the complete grid items when exporting.

Hope this information helps,
Princy.



Tags
Grid
Asked by
Felipe Saldana
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or