Questions about Gantt Printing

Hello,
I have two questions about Gantt Printing :

  • If I want to print Gantt with my own CSS style, I need to send something like this :

gantt.exportToPNG({ header:'<link rel="stylesheet" href="http://docs.dhtmlx.com/gantt/samples/common/customstyles.css" type="text/css">' });
Is it any way to do this on a private Network ? I can go outside but dhtmlx.com can’t directly load my CSS.

  • My gantt Tasks show a “variable” occupation. (Please, see attached pic)


    I can achieve this behaviour by adding a “dynamic style sheet” into document.styleSheets. With this, I simply put a custom CSS-class into desired gantt_task_cell.
    Can I expect the print as on my screen?

Instead of providing the reference you can include the content of stylesheet

gantt.exportToPNG({ header:'<style>.gantt_task_cell{ ...necessary styling... }</style>' });

Thanks Stanislav,

I’ve tried this :

        gantt.exportToPDF({
            header: "<style> .gantt_task_line{background: none!important;background-color:red!important}</style>"
        });

And it’s doesn’t work. Based on this jsfiddle.net/mkozhukh/WKJH5/
I don’t know what I’m doing wrong. Any idea ?

Update:

If I try gantt.exportToPDF({ header: '<link rel="stylesheet" href="http://mywebsite.fr/test.css" type="text/css">' });
where test.css contains .gantt_task_line{background: none!important;background-color:red!important}

That works.

one more thing that didn’t work :
If I add a custom CSS class on ‘gantt_task_cell’ elements. This class seem to be be ignored at printing.

.Dyn_1412287200000_13::after { content: '600%'; }

Hello Stanislav,

Do you have updates about this issue ?
I can apply a style on the PDF Gantt with a but not with direct CSS content as you mentioned…

Thanks for your help.