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

Index out of range with Biff Export

1 Answer 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
MBEN
Top achievements
Rank 2
Veteran
MBEN asked on 25 May 2016, 10:47 PM

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>

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 31 May 2016, 09:26 AM
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.
Tags
Grid
Asked by
MBEN
Top achievements
Rank 2
Veteran
Answers by
Maria Ilieva
Telerik team
Share this question
or