Export to iCal
The dhtmlxGantt library allows you to export data from the Gantt chart to the iCal format. The export goes through an export service: the online export service or the PDF/PNG/Excel export module.
To export data from the Gantt chart to an iCal string, do the following:
- To use the online export service, enable the export_api plugin via the plugins method:
gantt.plugins({
export_api: true
});
- Call the exportToICal method to export data from the Gantt chart:
<input value="Export to iCal" type="button" onclick='gantt.exportToICal()'/>
<script>
gantt.init("gantt_here");
gantt.parse(demo_tasks);
</script>
Related sample: Export data: MS Project, PrimaveraP6, Excel & iCal
Related sample: Export data: store online
Parameters of the export method
The exportToICal() method takes as a parameter an object with the following properties (optional):
- server - (string) sets the API endpoint for the request. Can be used with the local install of the export service. The default value is
https://export.dhtmlx.com/gantt; - name - (string) allows specifying custom name and extension for the file but the file will still be exported in the iCal format.
Calling the export method with optional properties
gantt.exportToICal({
server:"https://myapp.com/myexport/gantt"
});
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.