Exporting Custom Tasks and Filtered Data to PNG

Hey everyone,

We have a client request that I am currently experiencing issues with. I created a custom task that looks like a standard task, but with a dashed border. I have also setup task filtering. The problem is that when I try to export to png, all data is exported (Not just the filtered data displaying on screen), and my custom task styles are not displayed in the export.

Is there a way to make this work using the Gantt Api? If not, has anybody worked with exporting filtered data in the past? Any tips or direction would be appreciated.

This project uses: MySQL, Node, Express, and Jade.

Update: I also need to export markers, and I just realized that they are not exporting as well. Has this been done before?

Hi

(a) export of custom styles is possible for sure, just include the styles in the export command

docs.dhtmlx.com/gantt/desktop__e … outputfile

(b) © not possible for now

We plan to allow export of filtered data in one of the next updates ( you can expect the update till the end of January ). Possibility to export markers and any other js-code based content is a more long term task. While we have it in our plans, I can’t provide the exact date, when it will be available.

You say that exporting a gantt with custom styles is possible, but I am having trouble exporting to png with custom styles.

I took a look at the demo of this, which came with the api, and it is broke there as well:
localhost:8888/08_api/07_export_styles.html

^^My local setup:
export to pdf keeps my custom task styles, but export to png does not work. Please let me know if you need the exact files, but these came from dhtmlxGantt_v4.0.0/samples/04_customization/08_api/07_export_styles.html

I will be submitting a support ticket on this issue, but does anybody know of a work around in the meantime?

Please check
docs.dhtmlx.com/gantt/samples/08 … tyles.html

It is the same example online and it works.

There are two ways to include styles in the export

a) style tag with inline styles, works everywhere
b) link tag with reference to the used stylesheet. It will work only if this link is globally accessible ( export service will need to fetch it )

Hello,

are there any updates regarding exporting filtered data?

And what about exporting custom layers? Is this on your feature list?

Thank you!

It is not released officially yet, but you can try to use

gantt.exportToPNG({ raw:true });

It will export the HTML data of the gantt, exactly as it is rendered on moment of command call.

Thanks, I have tried the suggested solution. My experience:

  • it is good for filtering data,

but:

  • it still does not export the custom layers,
  • it ignores the time filter if it is set, always exports the whole period

So it does not fit our needs, we have to find another workaround.

it still does not export the custom layers,

Can you provide a snippet or a demo link, where the issue can be checked.

  • it ignores the time filter if it is set, always exports the whole period

Yep, I can confirm the issue, will be fixed in the next update