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
>