Exporting Data to PDF Format in ASP.NET Core Gantt Chart
PDF Export
PDF export allows exporting Gantt data to PDF document. You need to use the pdfExport method for exporting. To enable PDF export in the Gantt, set the allowPdfExport to true.
To export data to PDF document, inject the PdfExport module in Gantt.
NOTE
Currently, we don’t have support for exporting the manually scheduled tasks.
Indicators in PDF exporting
The PDF export functionality allows users to export Gantt charts enriched with dynamic indicators and accompanying images.
These indicators, represented by images,can be effortlessly defined using the base64 encoding value in the data object of datasource.This data object field should be mapped to indiactor property of task fields.
Exporting Gantt data as a blob object
In Gantt, you can export the Gantt chart data as a blob object, which allows you to preview or modify the data before exporting it.
To export the Gantt chart data as a blob object, follow these steps:
step 1: pdfExport fourth argument set as true.
step 2: Then , pdfExpComplete return as blob object.
Single page exporting in gantt
In Gantt, we have provided support to export the Gantt component where each rows are auto-fit to the PDF document page width by setting IsFitToWidth as true in FitToWidthSettings of PdfExportProperties.
Also, we can customize the chart width and grid width in exported file using ChartWidth and GridWidth by defining it as percentage in string.
Multiple exporting action in gantt control
PDF export provides an option for exporting multiple Gantt to same file. In this exported document, each Gantt will be exported to a new page of the document in same file.
Applying Themes in PDF Export
PDF export provides an option to include theme for the exported PDF document. To apply theme in exported PDF, define the theme in pdfExportProperties. The available themes are:
- Material
- Fabric
- Bootstrap
- Bootstrap 4