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

Hello Aravind,
The dev team updated the PDF export module to the 0.7.0 version. This includes the fix for the bug when the timeline is not fully displayed when using the cols: [rows:[]] layout configuration and exporting with the raw: true parameter.

Here is full list of changes:
https://docs.dhtmlx.com/gantt/desktop__pdf_export_module_whatsnew.html#070

If you use the online export server, you can try the beta export server that uses the latest version of the export module.

You can check how it works in the following snippets:

Main server:
https://snippet.dhtmlx.com/ytls1w1v
https://snippet.dhtmlx.com/1o1ij2l7

Beta server:
https://snippet.dhtmlx.com/9sleamvp
https://snippet.dhtmlx.com/rm7i50xd

After some time, the main server will use the newer version of the export module.

If you use the standalone export module, you can download the new version from the Client’s Area: