Excel Export in Server Binding Mode

1 Answer 12 Views
Grid ToolTip
Mengqing
Top achievements
Rank 1
Mengqing asked on 05 Oct 2021, 08:12 PM

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);
        }    

1 Answer, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 08 Oct 2021, 02:16 PM

Hi Mengqing,

Thank you for the code snippet and details provided.

In order to achieve the desired behavior, I would recommend trying the approach from the following forum thread answer:

Give a try to the approach above and let me know if further assistance is needed.

Kind Regards,
Anton Mironov
Progress Telerik

Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.
Tags
Grid ToolTip
Asked by
Mengqing
Top achievements
Rank 1
Answers by
Anton Mironov
Telerik team
Share this question
or