We are using dhtmlxGantt chart in our application. When there are around 500 tactics in web page then export to pdf is working perfect. But when number of tactics goes to 1000 it gives error like “Invalid Json data”. We looked into forums and came to know that it supports 4 MB json data. In our case size of json data is only 0.5 MB.
This is working perfect in firefox. Is there any limitation in Chrome for the same? Please confirm and provide some solution.
Seems like there is some threshold of number of elements after which pdf can not be opened. We’ll investigate why is this happening.
As a solution, you can try changing a zoom level of a time scale before exporting, in order to print a chart with a lower detalization, e.g.[code]// set lower resolution for the export
var scaleUnit = gantt.config.scale_unit;
var subscales = gantt.config.subscales;
gantt.config.scale_unit = “month”;
gantt.config.subscales = [];
gantt.exportToPDF();
// restore settings back after export is complete
gantt.config.scale_unit = scaleUnit;
gantt.config.subscales = subscales;[/code] docs.dhtmlx.com/gantt/snippet/1e69e362 - 1000 tasks, all seems ok again.
Alternatively, you can try exporting data by parts instead of printing the whole chart at once. You can do it using “data” property of exportToPDF config object docs.dhtmlx.com/gantt/desktop__export.html
However, I’ve never got “Invalid JSON data” so maybe your issue is caused by something else. If it’s so - please provide some kind of demo, where we could reproduce it.
Thanks a lot for your response. I have tried with the solution given by you but not able to resolve this issue. Then I have taken latest code for export gantt chart to pdf from http://export.dhtmlx.com/gantt/api.js link.
Hello Shivani,
We know about that issue, and it will be fixed in the future. Unfortunately, I don’t have a workaround, and I cannot give you any ETA, but I will notify you when the bug is fixed.
We have more than 1000 tasks in our list. when we export the pdf It only export pdf for first 500 tasks.
less than 500 tasks list working fine. we have our own server setup for exporting.
If you have the local export module, it shouldn’t be an issue as it can export huge charts.
You can download the newer version in the Client’s Area.
If the issue is still reproduced, please, contact the support team according to the instructions in the email with the license and provide a demo to reproduce the issue locally.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan