hello all ,
i try to export radgrid to pdf but it still blank,
this is my client side code :
and i've a radajaxmanager :
with this script function :
my code behind is :
thanks in advance .
i try to export radgrid to pdf but it still blank,
this is my client side code :
<
telerik:RadGrid
runat
=
"server"
ID
=
"ReservationsGrid"
MasterTableView-ShowHeadersWhenNoRecords
=
"true"
OnPdfExporting
=
"ReservationsGrid_PdfExporting"
OnNeedDataSource
=
"ReservationsGrid_NeedDataSource"
OnGridExporting
=
"ReservationsGrid_GridExporting"
AutoGenerateColumns
=
"false"
AllowPaging
=
"true"
OnItemCommand
=
"ReservationsGrid_ItemCommand"
>
<
PagerStyle
PageSizes
=
"10"
/>
<
ExportSettings
ExportOnlyData
=
"true"
Excel-Format
=
"Html"
></
ExportSettings
>
<
MasterTableView
CommandItemDisplay
=
"Top"
UseAllDataFields
=
"true"
>
<
CommandItemSettings
ShowExportToPdfButton
=
"true"
ShowExportToExcelButton
=
"true"
ShowExportToCsvButton
=
"true"
ShowExportToWordButton
=
"true"
></
CommandItemSettings
>
<
Columns
>
.........
and i've a radajaxmanager :
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
ClientEvents
OnRequestStart
=
"onRequestStart"
/>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"ReservationsGrid"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"ReservationsGrid"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
with this script function :
<
script
type
=
"text/javascript"
>
function onRequestStart(sender, args) {
if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
args.get_eventTarget().indexOf("ExportToPdfButton") >= 0 ||
args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
args.set_enableAjax(false);
}
}
</
script
>
my code behind is :
protected void ReservationsGrid_ItemCommand(object sender, GridCommandEventArgs e)
{
switch (e.CommandName)
{
case RadGrid.ExportToPdfCommandName:
ConfigureExport();
ReservationsGrid.MasterTableView.ExportToPdf();
break;
case RadGrid.ExportToExcelCommandName:
ConfigureExport();
ReservationsGrid.MasterTableView.ExportToExcel();
break;
case RadGrid.ExportToCsvCommandName:
ConfigureExport();
ReservationsGrid.MasterTableView.ExportToCSV();
break;
case RadGrid.ExportToWordCommandName:
ConfigureExport();
ReservationsGrid.MasterTableView.ExportToCSV();
break;
default:break;
}
}
public void ConfigureExport()
{
ReservationsGrid.ExportSettings.ExportOnlyData = true;
ReservationsGrid.ExportSettings.IgnorePaging = true;
ReservationsGrid.ExportSettings.OpenInNewWindow = true;
}
thanks in advance .