search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Is there any way to export range SVG/PNG in Gantt View?

Asked by Bikram Jeet Singh
1 year ago.

Hello,

I am using TypeScript in my project, was trying to export the gantt view. Couldn't find any documentation for the gantt view.

I was able to export the viewport and full view using:
(this.dp as any).exportAs("png").download();
But it didn't work for Range,
              
(this.dp as any).exportAs("png", {
                area: "range",
                dateFrom: startdate,
                dateTo: enddate,
              })

what should be the resource From/To in case of gantt chart
Answer posted by Dan Letecky [DayPilot]
1 year ago.

This should work fine - DayPilot.Gantt.exportAs() method uses the same syntax as DayPilot.Scheduler.exportAs().

However, the range defined using "dateFrom" and "dateTo" can only define a subset of the visible range. You can't use it to extend the range beyond what is loaded in the Gantt chart.

Comment posted by BIKRAM JEET SINGH
1 year ago.

Yes, but the above range code is not working, the startDate and endDate are between the start and end of Gantt chart

Comment posted by BIKRAM JEET SINGH
1 year ago.

Is it possible to use it without the resourceFrom and To as we have the concept of tasks in Gantt chart

Comment posted by BIKRAM JEET SINGH
1 year ago.

And the exportAs method is not present in the DayPilot Gantt types. I am using the DayPilot variable as any type.

Comment posted by Dan Letecky [DayPilot]
1 year ago.

> Yes, but the above range code is not working, the startDate and endDate are between the start and end of Gantt chart

You might need to check the actual values to make sure they are what you expect them to be. I've tested in in the demo example and it seems to work fine.

> Is it possible to use it without the resourceFrom and To as we have the concept of tasks in Gantt chart

You don't need to specify resourceFrom and resourceTo. If you want to specify them, use the task ID values.

> And the exportAs method is not present in the DayPilot Gantt types. I am using the DayPilot variable as any type.

It should be accessible now in the latest sandbox build (2023.1.5537):
https://release.daypilot.org/changes/js/

Comment posted by BIKRAM JEET SINGH
1 year ago.

Thanks a lot for the support!

Comment posted by Bikram Jeet Singh
1 year ago.

Its still not working, the dateFrom and dateTo are between the start and end of gantt chart.
Can you share a link where it it working?

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.