Index out of range with Biff Export

2 posts, 0 answers
  1. MBEN
    MBEN avatar
    159 posts
    Member since:
    Nov 2011

    Posted 25 May Link to this post

    I am using Excel-Format="Biff" for my excel exports.

    If there are no records in the grid, I get an index out of range error on clicking the export button. All other formats work fine. They just output an empty file but does not error out. I am unable to figure out why I get an index out of range error on the "biff" format export. Attached is the error details.

     

    I also tried the code with advanced databinding using NeedDatasource event but I see the same behavior.

     

     

    <telerik:RadGrid ID="rgParticipantBalances" runat="server" DataSourceID="_dataSrcBalances" OnPreRender="rgParticipantBalances_PreRender"
                    OnItemCommand="rgParticipantBalances_ItemCommand" OnItemDataBound="rgParticipantBalances_ItemDataBound"
                    OnItemCreated="rgParticipantBalances_ItemCreated" AllowFilteringByColumn="true"  >
                    <FilterItemStyle HorizontalAlign="Left" />
                    <MasterTableView TableLayout="Fixed" HierarchyDefaultExpanded="false" CommandItemDisplay="Top"
                        DataKeyNames="" EnableNoRecordsTemplate="true">
                        <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" ShowExportToExcelButton="true"
                            ExportToExcelText="" ExportToCsvText="" ExportToPdfText="" ExportToWordText=""
                            ShowExportToPdfButton="true" ShowExportToWordButton="true" ShowExportToCsvButton="true" />
                        <NoRecordsTemplate>
                            <div style="color: Red; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold">
                                <br />
                                Please select a plan to show activity for the specific plan.
                            </div>
                        </NoRecordsTemplate>
                        <Columns>
                            <telerik:GridTemplateColumn UniqueName="Participant" HeaderText="Participant" SortExpression="FullName"
                                HeaderStyle-HorizontalAlign="Left" CurrentFilterFunction="Contains" ShowFilterIcon="false"  DataField="FullName"
                                ItemStyle-HorizontalAlign="Left" FooterStyle-HorizontalAlign="Left" AutoPostBackOnFilter="true"
                                HeaderStyle-Width="16%" FilterControlWidth="130px" FilterControlToolTip="Input a name or part of name to search">
                                <ItemTemplate>
                                    <%# Eval("FullName")%>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:Label ID="lblGrandTotal" runat="server" Text="Grand Total" Font-Bold="true"></asp:Label>
                                </FooterTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                    <ExportSettings ExportOnlyData="true" IgnorePaging="true" FileName="Activity" OpenInNewWindow="true" HideStructureColumns="true"
                        SuppressColumnDataFormatStrings="false">
                        <Pdf PaperSize="A4" PageLeftMargin="5px" PageRightMargin="5px" PageWidth="297mm"
                            PageHeight="210mm" />
                        <Excel  Format="Biff"   />
                    </ExportSettings>
                </telerik:RadGrid>

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 31 May Link to this post

    Hi,

    You can see the demo below where the exporting to BIFF functionality works as expected:
    http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/exporting/excel-export/defaultcs.aspx

    As we are not able to replicate the issue on our end, it will be best if you can open a regular support ticket and s end us isolated runnable version  f your application that demonstrates the issue. Thus we will be bale to debug it locally and advise you further.

    Regards,
    Maria Ilieva
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top