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

Export to PDF

1 Answer 546 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Maulik
Top achievements
Rank 1
Maulik asked on 05 Dec 2014, 01:56 AM
Hi,

I am using new functionality Export to PDF manually on click event. I can rename my excel file but not sure how to rename pdf file in manual export.

exportToExcel: function (gridId, fileName) {
        var grid = $("#" + gridId).data("kendoGrid");
        grid.bind("excelExport", function (e) {
            e.workbook.fileName = fileName + ".xslx";
        });
        grid.saveAsExcel();
    },

    exportToPDF: function (gridId, fileName) {
        var grid = $("#" + gridId).data("kendoGrid");
        grid.bind("pdfExport", function (e) {
        //    e.workbook.fileName = fileName + ".pdf";
        });
        grid.saveAsPDF();
    },

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 05 Dec 2014, 02:40 PM
Hello Maulik,


You could set the custom name in the Grid PDF options before invoking the saveAsPDF() method.
E.g.
grid.options.pdf.fileName = "customName";
grid.saveAsPDF();

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Maulik
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or