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

Kendo Export Not working - when scrolling is enabled

5 Answers 516 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stephan
Top achievements
Rank 1
Stephan asked on 03 Dec 2015, 12:27 AM

I have a kendo grid within a page which is scrollable and grouped by default.  While exporting data the grid data is not completely rendering.  It shows only the partial data within the view.  How to fix this?

 

5 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 03 Dec 2015, 12:17 PM

Hello Stephan,

I was unable to reproduce the behavior in the following demo. Do you mean that only the current page is exported? If that is the case, you should enable the allPages option of the Excel export configuration.

Regards,
Dimiter Madjarov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Stephan
Top achievements
Rank 1
answered on 03 Dec 2015, 01:16 PM

Hi Dimiter,

Thanks for your response.  Am generating pdf for my Kendo grid.  As my grid is scrollable (shows only first 4 records and rest of the records can be viewed only after scrolling).  All my records are within a single page.  While generating pdf, it is showing the initial records (first 4 records that can be viewed without scrolling ) like a screenshot of the records, not the entire grid.

 Also could you tell me how to set allPages option to true dynamically instead of setting it in kendo grid using js?

0
Stephan
Top achievements
Rank 1
answered on 03 Dec 2015, 09:13 PM

Also to add more information, am using mvc kendo grid.  I need to combine three div in the page which include kendo grid div to create a single pdf in an button click event.

 This is my piece of code.

getPDF: function (sendPdf) {

        var self = this;

        var root = new kendo.drawing.Group();

        //Creating drawing for two form div 
        var x = document.getElementsByClassName(self.selectors.pdfSelector);
        for (var i = 0; i < x.length; i++) {
            kendo.drawing.drawDOM(x[i]).then(function (group) {
                root.append(group);
            });
        }

        //Creating drawing for Kendo grid
        kendo.drawing.drawDOM(self.selectors.Grid).then(function (group) {
            root.append(group);
        });

        //Appended all those in a single root group

        return kendo.drawing.exportPDF(root, {
            paperSize: "auto",
            margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" },
            multiPage: true
        })
        .done(function (data) {
            // Save the PDF file
            kendo.saveAs({
                dataURI: data,
                fileName: "IsciCode.pdf",
            });
        });

 

My problem is similar to this sample where grid in the pdf is incomplete

https://demos.telerik.com/kendo-ui/pdf-export/index

 

0
Accepted
Dimiter Madjarov
Telerik team
answered on 04 Dec 2015, 08:31 AM

Hello Stephan,

I was unable to reproduce the behavior with both, allPages set to true and false. Here is a short example that demonstrates this. The behavior is the same in the MVC Grid.

Regarding the second question, you could achieve this via JavaScript through the Grid options.
E.g.

var grid = $("#grid").data("kendoGrid");
grid.options.pdf.allPages = false

If you would like to add additional content to the PDF document and export all Grid pages, you could use the approach from the following help topic.

Regards,
Dimiter Madjarov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Stephan
Top achievements
Rank 1
answered on 04 Dec 2015, 08:19 PM

Thank you so much Dimiter.  This is the part exactly what i expected, which initiate grid pdf creation programmatically.  

grid._drawPDF(progress)

Tags
Grid
Asked by
Stephan
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Stephan
Top achievements
Rank 1
Share this question
or