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

Changing the scrollable property for printing?

6 Answers 302 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sypher
Top achievements
Rank 1
Sypher asked on 17 Apr 2013, 08:36 PM
I have a grid that is set to scrollable:true, but I would like it to be false during printing. I can use a print button that does some settings, calls window.print(), then cleans up the settings, but I'm not sure if I can set the scrollable property to false in that way.

I already do a lot of separate styling in CSS for printing, but the issue I can't get around for the scrollable grid is the separate table for the fixed column headers. It doesn't allow the headers to be printed on each page (in non-WebKit browsers) like normal thead rows in a single table.

It would be possible for me to create a separate grid just for printing, but I have around 16 in the app so far and I would like the user's choices of sorting and filtering to be kept, so I'd rather not do that.

Ideas?

6 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 19 Apr 2013, 07:41 AM
Hi Bryan,

The Grid scrollbar is removed during printing via print CSS. However, this will not be good enough if the table rows are too many to fit on a single sheet of paper, as you have observed. So your options are:

1) reduce the Grid page size
2) destroy the Grid and create a new one with scrolling disabled, setting all sort and filter expressions manually to the dataSource by using its API
3) if option (2) seems too unattractive, you can try getting the innerHTML of the Grid data and its headers, generate a new <table> element on the page and print that instead.

Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sypher
Top achievements
Rank 1
answered on 19 Apr 2013, 02:15 PM
Thanks, Dimo. Not what I wanted to hear, but it is what I was expecting. At least now I know I'm not missing the easy solution. :-)

Bryan
0
Teguh
Top achievements
Rank 1
answered on 14 Jun 2016, 05:19 AM

Hi, 

I have similar challenges. Since this topic has been around quite a while, is there been any other solution that requires less time to implement? :)

0
Dimo
Telerik team
answered on 14 Jun 2016, 07:42 AM
Hi Teguh,

The following documentation page demonstrates how to print a scrollable Grid. This is the approach that we can offer at this point.

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

Let me know if you have any specific questions.

Regards,
Dimo
Telerik
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
0
Teguh
Top achievements
Rank 1
answered on 14 Jun 2016, 07:48 AM

Hi Dimo, 

Thanks for the prompt response.

My main concern is that we have a page with multiple grids, and if we have to customise each of them this would be taking too much time.

Is there any way to make the grid overflow properly without overlapping the control bellow it? Would it be possible to use a css page break after the grid ends?

Might also worth mentioning that our grids are wrapped in section.

Regards, 

TS

0
Dimo
Telerik team
answered on 14 Jun 2016, 11:26 AM
Hello Teguh,

The raised topics are related to general web page printing techniques. The same concerns would apply if you have several HTML tables inside scrollable parents. In case you would like to benefit from our technical advice on this scenario, I can recommend our Professional Services.

http://www.telerik.com/professional-services

Regards,
Dimo
Telerik
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Tags
Grid
Asked by
Sypher
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Sypher
Top achievements
Rank 1
Teguh
Top achievements
Rank 1
Share this question
or