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

How to export Gantt chart for range opttion

Asked by Bikram Jeet Singh
3 months ago.

Hello,

I was trying to export the Gantt chart for range feature. using the below function,

Here: exportType is svg/png, planned start/end dates are the starting and ending dates of the range.

Are ResourceFrom and ResourceTo are mandatoty? What to use for these values in n Gantt View.

this.dp.exportAs(this.state.exportType?.toLowerCase(), {
  area: "range",
  dateFrom: new DayPilot.Date(this.state.PlannedStartDate),
  dateTo: new DayPilot.Date(this.state.PlannedEndDate),
});

Nothing is being done here, no errors, no file downloads. The area option “Full” and “Viewport” are working.

Thank you.

Answer posted by Dan Letecky [DayPilot]
3 months ago.

The exportAs() method returns a DayPilot.Export which you can use to get the exported object, start a download, etc.

To download the image immediately, you can use this:

this.dp.exportAs(this.state.exportType?.toLowerCase(), {
  area: "range",
  dateFrom: new DayPilot.Date(this.state.PlannedStartDate),
  dateTo: new DayPilot.Date(this.state.PlannedEndDate),
}).download();

Th resourceFrom and resourceTo are optional. You can use them to limit the export vertically (by specifying the first and last task IDs).

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