Kendo Gantt print in Angular

1 Answer 147 Views
Gantt
JuanFran
Top achievements
Rank 1
JuanFran asked on 21 Dec 2023, 05:44 AM
I desperately need the function to print the Gantt. I have managed to hand-make the function to print the table part, but I need to know how I can print the Gantt part, at least until the functionality is available. I'm trying to print the element:

document.getElementsByTagName('kendo-gantt-timeline')[0]

But it gives me size problems and problems with .k-gantt-dependencies-svg.

Can you help me?

1 Answer, 1 is accepted

Sort by
0
Stoyan
Telerik team
answered on 25 Dec 2023, 11:41 AM

Hi JuanFran,

Thanks for the provided information.

Currently, as you've stated, the Kendo UI for Angular Gantt component does not have a printing functionality. What I can advice is to log a feature request in our FeedBack Portal where we triage feature requests based on their popularity.

Furthermore, Ive created a StackBlitz demo that demonstrates how to use the window.print() functionality to output the Gantt component:

https://stackblitz.com/edit/angular-kjhrms?file=src%2Fapp%2Fapp.component.ts

Another workaround would be to utilize the window.open() function and stuff the desired HTML which should be printed. More on this topic:

https://www.geeksforgeeks.org/print-the-contents-of-a-div-element-using-javascript/

I hope this information helps.

Regards,
Stoyan
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
JuanFran
Top achievements
Rank 1
commented on 26 Dec 2023, 07:17 AM

First of all, thank you for responding, I am stuck with this topic and I can't find the ideal way to get it done. I have tried the two ways that you mentioned and the only one that may work for me is window.print, but it has a size limitation, when the Gantt is very large it is not suitable as a solution.

On the other hand, window.open loses all the styles and it is very complicated to make it look good, or at least I haven't managed to do it. The truth is that it is frustrating not to have this export option for Angular. If there was another way to do it I would appreciate it.

Also thanks for the help!

Yanmario
Telerik team
commented on 28 Dec 2023, 09:04 AM

Hi JuanFran,

I comprehend the significance of this feature to you, and Stoyan's suggestions are indeed valid. However, implementing custom logic is necessary, and there are still some issues to address since the component is not currently designed for use with printing functionality. On that note, I will open a feature request thread on this matter at the following link:

https://feedback.telerik.com/kendo-angular-ui/1635672-gantt-add-printing-functionality-to-the-component

I also played around a bit with styles when printing, but it seems that I wasn't able to adjust the Gantt to fit the paper as it can get quite large. 

If the feature is crucial, I would suggest checking with our Professional Services team for a possible solution as it would be very custom to specific application requirements.  

Regards,
Yanmario
Progress Telerik

Tags
Gantt
Asked by
JuanFran
Top achievements
Rank 1
Answers by
Stoyan
Telerik team
Share this question
or