export-data
PRO
The functionality is available in PRO Edition only
Description
Triggers export of Gantt data to PDF, PNG, Excel, or MS Project XMLThe export-data action allows exporting Gantt data to PDF, PNG, Excel, or MS Project XML formats.
If url is provided, the action sends the current Gantt state to a ready-made server-side export service which generates files in PDF, PNG, XLSX, or MS Project XML (MSPX) formats.
If url is not provided (MS Project XML only), the action exports data using client-side logic.
Export mechanism allows overriding layout, sizing, styling, and Gantt configuration without affecting the live Gantt instance.
Usage
"export-data": ({
url?: string,
format?: "pdf" | "png" | "xlsx" | "mspx",
fileName?: string,
styles?: string,
ganttConfig?: Record<string, any>,
pdf?: {
fitSize?: boolean,
size?: "auto" | "a4" | "a3" | {
width: number,
height: number,
},
landscape?: boolean,
styles?: string,
margins?: {
top?: number,
bottom?:number,
left?: number,
right?: number,
},
header?: string,
footer?: string,
scale?: number,
},
png?: {
fitSize?: boolean,
size?: "auto" | string | {
width: number,
height?: number,
},
landscape?: boolean,
styles?: string,
},
excel?: {
sheetNames?: string[],
visual?: boolean,
dateFormat?: string,
columns?: {
id: string,
header?: string,
type?: "string" | "number" | "date" | "progress",
width?: number,
}[],
},
}) => void;
Parameters
url- (optional) export service endpoint, recommendedhttps://export.svar.dev/gantt/{version}format- (optional)"pdf" | "png" | "xlsx" | "mspx". Default value is "pdf"fileName- (optional) name of the exported file, without extension. Default value is "gantt"styles- (optional) CSS string applied to the exported documentganttConfig- (optional) overrides Gantt configuration for export only
PDF-specific options (pdf)
fitSize- (optional) scale the chart to fit the pagesize- (optional) page size, can be:"auto"- automatic sizing"a4"|"a3"- standard paper sizes{ width: number, height: number }- custom size in pixels
landscape- (optional) boolean, set totruefor landscape orientationstyles- (optional) custom css applied in pdf exportmargins- (optional) page marginstop- (optional) top margin in pixelsbottom- (optional) bottom margin in pixelsleft- (optional) left margin in pixelsright- (optional) right margin in pixels
header- (optional) text or HTML to display in page headerfooter- (optional) text or HTML to display in page footerscale- (optional) manual scaling factor for chart,0.1-2.0