How to include grouping task (with bar ) when I export PDF/Image/Excel

Hi Team,

I am using paid version of dhtmlx Gantt. In my project, we are using export PDF/ Image/Excel feature.

As per my new requirement I need to show the tasks with grouping when I export .

Kindly help me to solve the issue.
I have attached the image .

Current output :

gantt (4).pdf (61.4 KB)

expected behavior:

why high, low, normal on top ? not in the respective group

Hello Aravind,
If you group tasks and export the data to PDF and PNG, you need to enable the raw mode:
https://docs.dhtmlx.com/gantt/desktop__export.html#exportingcustommarkupandstyles
For Excel export, there is no raw mode, but it should work anyway.

Here is an example in the snippet:
https://snippet.dhtmlx.com/3412eg90

If that doesn’t help you, probably, the issue is related to the Gantt configuration, but it is hard to suggest what might be wrong as I don’t see your code.
In that case, please, add your configuration to the following snippet and make sure that the issue is reproduced there:
https://snippet.dhtmlx.com/40tsh9uz
Then, click on the Share button and send me the link.
Or send me a ready demo with all the necessary Javascript and CSS files so that I can reproduce the issue locally.

Hi Ramil,

Thanks for your reply. as you mentioned I have added the source code . Please refer this link source code

after add the below gantt_container configuration , we are able to download pdf but that pdf not containing all the task bar (refer attached PDF) . kindly help us to resolve the issue.

gantt.config.layout = {
css: “gantt_container”,
cols: [
{
width:400,
min_width: 300,
rows:[
{view: “grid”, scrollX: “gridScroll”, scrollable: true, scrollY: “scrollVer”},
{view: “scrollbar”, id: “gridScroll”, group:“horizontal”}
]
},
{resizer: true, width: 1},
{
rows:[
{view: “timeline”, scrollX: “scrollHor”, scrollY: “scrollVer”},
{view: “scrollbar”, id: “scrollHor”, group:“horizontal”}
]
},
{view: “scrollbar”, id: “scrollVer”}
]
};
Output before add the above code:
before.pdf (49.5 KB)

Output after add the above code .

after.pdf (42.5 KB)

Hello Aravind,
Thank you for sending the snippet.
The issue occurs because of a bug in Gantt. The dev team will fix it in the future, but I cannot give you any ETA.
As a workaround, you can add the style rule to extend the timeline for the export functions:

gantt.exportToPDF({
  header:`<style>.timeline_cell{width: ${gantt.$task_data.scrollWidth}px !important;}</style>`,
  raw: true
});

Here is the updated snippet:
https://snippet.dhtmlx.com/6843uk39