The exportAs() method exports the Scheduler in the specified format (SVG, PNG, JPEG, XLSX).
Export to Excel spreadsheet (XLSX) is supported since version 2025.1.6418.
DayPilot.Scheduler.exportAs(format[, options]);
format
: "svg"
| "png"
| "jpeg"
| "xlsx"
options.area
- specifies the exported area ("viewport"
, "full"
or "range"
); if not specified, "viewport"
will be used
options.dateFrom
- start date (applies only to area: "range"
)
options.dateTo
- end date (applies only to area: "range"
)
options.resourceFrom
- start resource (applies only to area: "range"
)
options.resourceTo
- end resource (applies only to area: "range"
)
Image export:
options.quality
- quality of the output JPEG image (applies only to format: "jpeg"
); if not specified, 0.92
will be used
options.scale
- sets the scale of the output; if not specified, 1
will be used (to magnify the output to 200%, use a value of 2)
Excel export:
options.mime
- sets a custom MIME type for the exported file (the default value is "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
)
options.transformWidth
- a function that converts a pixel value to Excel column width units (the default value is (width) => (width - 5) / 7
)
options.transformHeight
- a function that converts a pixel value to Excel row height units (the default value is (height) => height * 0.75
)
A DayPilot.Export
object that provides the following methods:
toElement()
- returns DOM element with the image (<svg> or <img>)
toHtml()
- returns DOM element as HTML
toDataUri()
- returns a dataURI string (SVG or image data)
toBlob()
- returns a Blob object
download(filename)
- initiates immediate download of the image
print()
- prints the exported image using the browser print dialog
For Excel export, the object has only the following methods:
download(filename)
- initiates immediate download of the XLSX file
toBlobAsync()
- returns a Promise<Blob>
object