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

PDF Export with width columns = breaking page failing

1 Answer 309 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Maxime
Top achievements
Rank 1
Maxime asked on 31 May 2019, 07:25 AM

Hello All,

When I specify width columns in my css, the pdf grid export does not break page correctly. It breaks page in the middle of a row...

Here is a sample from Alex (https://dojo.telerik.com/@bubblemaster/UQOcIs/2). Please add code my css to specify width columns and export the pdf:

.k-pdf-export colgroup > col:nth-child(1) {
    width: 80px !important;
}
.k-pdf-export colgroup > col:nth-child(2) {
    width: 55px !important;
}

You will see that it does not break page when it should.

 

I can't understand why.

 

Any idea ?

Thank you

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 04 Jun 2019, 06:38 AM
Hi Maxime,

Thank you for the provided Dojo sample which you are currently testing. 

I have noticed that when the styles are applied to the relevant columns, the width is narrow and the content of that cell could not be fitted on one page. When the content of most of the elements could not be fit on one page, then they are truncated. That is why the unexpected behavior is present, the rows are truncated and the page breaking mechanism does not work properly. 

Splitting of certain HTML elements is not supported by the exporting functionality. The tr elements of the grid are part of the list with elements which could not be split. More information on the Limitations of the page breaking could be found here:

https://docs.telerik.com/kendo-ui/framework/drawing/drawing-dom#limitations-on-page-breaking

Given the scenario on hand, what I can recommend is that you specify width large enough so that the whole content of the cells fit on one page. If you would like, the page breaking mechanism could be applied either automatically or manually. Additional details could be found in the article below:

https://docs.telerik.com/kendo-ui/framework/drawing/drawing-dom#multi-page-content

Let me know in case additional information is required.


Kind regards,
Tsvetomir
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Maxime
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Share this question
or