Problem: IgnorePaging not Working on DetailTables BIFF Excel Export

1 posts, 0 answers
  1. Matthew
    Matthew avatar
    7 posts
    Member since:
    Jan 2018

    Posted 17 Jan 2018 Link to this post

    Hi.  I'm trying to export data to Excel using BIFF with Telerik version 2016.3.1027.40-.  The data that needs to be included in the spreadsheet is in a detail table with paging.  My code successfully exports data only on the first page displayed on the UI.  I've implemented the suggestion here https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/exporting/overview#ignorepaging-not-working-on-detailtables-excel-export to disable paging but it didn't work in my case.  Can someone tell me how I can achieve this functionality given this as my view code

     

    <telerik:Radgrid Rendermode="Lightweight" ID="RadGrid1" runat="server" showstatusbar="true" autogeneratecolumns="False" AllowFilteringByColumn="True" pagesize="10" allowsorting="True" allowmultirowselection="False" allowpaging="True" Filtertype="Combined"              
    onneeddatasource="RadGrid1_NeedDataSource"   oniteminserted="RadGrid1_ItemInserted"               onitemcommand="RadGrid1_ItemCommand" oninsertcommand="RadGrid1_InsertCommand" onupdatecommand="RadGrid1_UpdateCommand"  onitemdatabound="RadGrid1_ItemDataBound" ondetailtabledatabind="RadGrid1_DetailTableDataBind" OnDeleteCommand="RadGrid1_DeleteCommand" Skin="Outlook" OnItemCreated="RadGrid1_ItemCreated" ShowExportToExcelButton="true"               onBiffExporting="RadGrid1_BiffExporting">   
          
    <MasterTableView  AutoGenerateColumns="False" UniqueName="CATDESCRIPTION" AllowMultiColumnSorting="True" DataKeyNames="CAT_DESCRIPTION"  PagerStyle-AlwaysVisible="true" EditMode="InPlace" CommandItemDisplay="Top">               
       <DetailTables>                  
          <telerik:GridTableView DataKeyNames="pk" Name="Codes" TableLayout="Auto" EditMode="InPlace" PagerStyle-AlwaysVisible="true" CommandItemDisplay="Top">                       
    <CommandItemSettings ShowExportToExcelButton="true" />             
    <CommandItemSettings AddNewRecordText="Add Rule" />
    Additional code omitted...

     

    and this is part of the code-behind:

    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) {
      if (e.CommandName.Equals(Telerik.Web.UI.RadGrid.ExportToExcelCommandName)) {              
          RadGrid1.ExportSettings.Excel.Format = GridExcelExportFormat.Biff;
          RadGrid1.ExportSettings.FileName = "Output";
          RadGrid1.ExportSettings.ExportOnlyData = true;
          RadGrid1.ExportSettings.OpenInNewWindow = true;
     
          //disable paging on the main grid for the export operation
          RadGrid1.ExportSettings.IgnorePaging = false;
          //expand detail tables
          RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
          RadGrid1.MasterTableView.DetailTables[0].HierarchyDefaultExpanded = true;
     
          foreach (GridTableView tbl in RadGrid1.MasterTableView.DetailTables) {
              tbl.HierarchyDefaultExpanded = true;
              //disable paging for the detail grids for the export operation
              tbl.AllowPaging = false;
           }
         }
    }
Back to Top