Hi,
I couldn't add the Export to Excel feature to my Dashboard due to the system error "Excel Export in Server Binding Mode".
I am wondering if it is doable by changing my current code. (As an example, I pasted one of the Dashboard tabs that we'd like to be able to download to Excel).
Thank you!
items.Add()
.Text("LLL")
.Content(@<text>
<b>All values in $mn</b>
<div>
@(Html.Kendo().Grid(Model.LLL_Item).Name("LLL")
.Columns(col =>
{
col.Bound(c => c.Asset).Title("Asset").Width(200);
col.Bound(c => c.Current).Title("Current").Format("{0:C}").Width(100);
col.Bound(c => c.YE0).Title("Year End").Format("{0:C}").Width(100);
col.Bound(c => c.YE1).Title("Year 1").Format("{0:C}").Width(100);
col.Bound(c => c.YE2).Title("Year 2").Format("{0:C}").Width(100);
col.Bound(c => c.YE3).Title("Year 3").Format("{0:C}").Width(100);
col.Bound(c => c.YE4).Title("Year 4").Format("{0:C}").Width(100);
col.Bound(c => c.YE5).Title("Year 5").Format("{0:C}").Width(100);
})
.ToolBar(tools => tools.Excel())
.Excel(excel => excel
.FileName("Export.xlsx")
.Filterable(true)
.ProxyURL(Url.Action("Excel_Export_Save", "Reports"))
))
</div>
And in Controller I have this:
[HttpPost]public ActionResult Excel_Export_Save(string contentType, string base64, string fileName)
{
var fileContents = Convert.FromBase64String(base64);
return File(fileContents, contentType, fileName);
}