This is a migrated thread and some comments may be shown as answers.

Upgraded from 2016.1.412 to 2017.1.118 and now receiving "kendo.util.encodeBase64 is not a function"

1 Answer 24 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Doug asked on 21 Feb 2017, 09:58 PM

I've been using the below code snippet to save a filtered grid (with paging) to an Excel file with no issues.  Once I upgraded I'm getting the above error "kendo.util.encodeBase64 is not a function"

01.function saveExcel(e) {
02.    e.preventDefault();
03.    var dataUri = "data:text/plain;base64," + kendo.util.encodeBase64(JSON.stringify(e.data));
04.    kendo.saveAs({
05.        dataURI: dataUri,
06.        proxyURL: "@Url.Action("ExcelExport", "ControllerName")",
07.        forceProxy: true
08.    });
09.}

 

 

Did this function go away or change?  Is there a better way to save an Excel file that needs to pull more columns than that is on the grid, that is also filtered and has paging.  Basically my MVC controller method does a data pull based on the filter of the grid.

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 23 Feb 2017, 07:03 AM
Hi Doug,

The mentioned method is intended for internal use only, and this is why it is not documented, but of course you can still use it, if you need. It was moved, and now can be called via kendo.drawing.uitls.encodeBase64(input).

I am not sure I fully understand the specifics of the particular custom scenario, but in general the Grid can be exported to Excel via its saveAsExcel() method. Further details, and examples for exporting a Kendo UI Grid to Excel are available in the following section of our documentation:

http://docs.telerik.com/kendo-ui/controls/data-management/grid/excel-export

You can also check out the Grid excel export online demo:

http://demos.telerik.com/kendo-ui/grid/excel-export

You can customize the exported workbook in the Grid excelExport event handler where the kendo.ooxml.Workbook is available via e.workbook, e.g.:

http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/excel/export-checked-columns-only

http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/excel/column-template-export

If you need to create an excel file, based on some data, from scratch, you can check out the following section of our documentation:

http://docs.telerik.com/kendo-ui/framework/excel/introduction

I hope this helps.

Regards,
Dimiter Topalov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Doug
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or