All docs
V21.2
21.2
21.1
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

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