Hi ,
I am trying to use the export feature of the grid using tag helper but somehow I can't make it work using tag helper or even jquery
<
toolbar
>
<
toolbar-button
name
=
"excel"
></
toolbar-button
>
</
toolbar
>
<
excel
file-name
=
"Kendo.xlsx"
filterable
=
"true"
proxy-url
=
"/PlanCodeGroup/Excel_Export_Save"
/>
my entire grid
<
kendo-grid
name
=
"plancodegroupgrid"
height
=
"600"
on-data-bound
=
"dataBound"
on-remove
=
"onremove"
>
<
datasource
type
=
"DataSourceTagHelperType.Ajax"
server-filtering
=
"true"
server-paging
=
"true"
page-size
=
"100"
on-request-end
=
"onrequestend"
>
<
transport
>
<
read
url
=
"planCodeGroup/PlanCodeGroup_Read"
/>
<
update
url
=
"planCodeGroup/PlanCodeGroup_Update"
/>
</
transport
>
<
schema
>
<
model
id
=
"PlanCodeGroupID"
>
<
fields
>
<
field
name
=
"PlanCode"
editable
=
"false"
></
field
>
<
field
name
=
"RateScaleCode"
editable
=
"false"
></
field
>
<
field
name
=
"PolicyTypeCode"
editable
=
"false"
></
field
>
<
field
name
=
"RiskIntegrityGroupPrefixCode"
></
field
>
<
field
name
=
"SystemName"
editable
=
"false"
></
field
>
<
field
name
=
"StartDate"
editable
=
"false"
type
=
"date"
></
field
>
<
field
name
=
"EndDate"
type
=
"date"
></
field
>
</
fields
>
</
model
>
</
schema
>
</
datasource
>
<
toolbar
>
<
toolbar-button
name
=
"excel"
></
toolbar-button
>
</
toolbar
>
<
excel
file-name
=
"Kendo.xlsx"
filterable
=
"true"
proxy-url
=
"/PlanCodeGroup/Excel_Export_Save"
/>
<
sortable
enabled
=
"true"
mode
=
"multiple"
indexes
=
"true"
/>
<
filterable
enabled
=
"true"
mode
=
"row"
/>
<
editable
mode
=
"inline"
confirmation
=
"false"
/>
<
columns
>
<
column
field
=
"PlanCode"
title
=
"@localizer["
PlanCode"].Value">
<
filterable
>
<
cell
show-operators
=
"false"
></
cell
>
</
filterable
>
</
column
>
<
column
width
=
"150"
field
=
"RateScaleCode"
title
=
"@localizer["
RateScale"].Value">
<
filterable
>
<
cell
show-operators
=
"false"
></
cell
>
</
filterable
>
</
column
>
<
column
width
=
"150"
field
=
"PolicyTypeCode"
title
=
"@localizer["
PolicyType"].Value">
<
filterable
>
<
cell
show-operators
=
"false"
></
cell
>
</
filterable
>
</
column
>
<
column
width
=
"150"
field
=
"SystemName"
title
=
"@localizer["
System"].Value">
<
filterable
>
<
cell
show-operators
=
"false"
></
cell
>
</
filterable
>
</
column
>
<
column
field
=
"RiskIntegrityGroupPrefixCode"
editor
=
"riskIntegrityGroupPrefixCodeEditor"
title
=
"@localizer["
GroupPrefix"].Value">
<
filterable
>
<
cell
show-operators
=
"false"
></
cell
>
</
filterable
>
</
column
>
<
column
field
=
"StartDate"
title
=
"@localizer["
Start Date"].Value"
format
=
"{0:MM/dd/yyyy}"
>
<
filterable
>
<
cell
show-operators
=
"false"
></
cell
>
</
filterable
>
</
column
>
<
column
field
=
"EndDate"
title
=
"@localizer["
EndDate"].Value"
format
=
"{0:MM/dd/yyyy}"
>
<
filterable
>
<
cell
show-operators
=
"false"
></
cell
>
</
filterable
>
</
column
>
<
column
width
=
"150"
>
<
commands
>
<
column-command
text
=
" "
name
=
"edit"
></
column-command
>
<
column-command
text
=
" "
name
=
"destroy"
></
column-command
>
</
commands
>
</
column
>
</
columns
>
<
scrollable
height
=
"auto"
enabled
=
"true"
/>
</
kendo-grid
>
finally my controller
I can see my Read Action being read when I click the export button but after that nothing happen.
I even try via jquery to do a grid.SaveAsExcel(). same result nothing happen also no errors in console.
public
IActionResult PlanCodeGroup_Read([DataSourceRequest] DataSourceRequest request)
{
var plancodeGroups = _mapper.Map<List<PlanCodeGroupModel>>(_planCodeService.GetAllPlanGroups());
return
Json(plancodeGroups.ToDataSourceResult(request));
}
[HttpPost]
public
ActionResult Excel_Export_Save(
string
contentType,
string
base64,
string
fileName)
{
var fileContents = Convert.FromBase64String(base64);
return
File(fileContents, contentType, fileName);
}