Skip to main content
A newer version of this page is available. .
All docs
V21.2

ASPxClientGantt.ExportToPdf(options) Method

Exports Gantt chart data to a PDF document.

Declaration

ExportToPdf(
    options: any
): any

Parameters

Name Type Description
options any

PDF export options.

Returns

Type Description
any

The PDF document.

Remarks

The ExportToPdf method allows you to save information about the Gantt chart’s layout, appearance, and tasks. This method supports the following options:

  • format {string | width?: number, height?: number } - Specifies the document size.
  • pdfDocument - {jsPDF} - Specifies the PDF document.
  • landscape {boolean} - Specifies whether to use horizontal orientation for the document.
  • fileName {string} - Specifies the file name.
  • exportMode {“all”, “treeList”, “chart”} - Specifies which part of the component to export (chart area, tree list area, or the entire component).
  • dateRange: {“all” | “visible” | startDate? : Date, endDate? : Date, startIndex? : number, endIndex? : number } - Specifies the date range for which to export tasks.
  • margins { left?: number, top?: number, right?: number, bottom?: number } - Specifies the outer indents of the exported area.

Run Demo: ASPxGantt - Export to PDF Run Demo: MVCxGantt - Export to PDF

<dx:ASPxGantt ID="Gantt" runat="server" ClientInstanceName="clientGantt" >
    //...
</dx:ASPxGantt>
var exportOptions = {
    format: "A4",
    landscape: true,
    exportMode: "chart",
    dateRange: "visible"
};
clientGantt.ExportToPdf(exportOptions);
See Also