Blog
All Blog Posts | Next Post | Previous Post
Share your Gantt Chart with the PDF and Print IO components
Wednesday, July 24, 2024
Efficient project management often requires the ability to share, print, and customize project timelines and task lists. The TTMSFNCGanttChartPDFIO and TTMSFNCGanttChartPrintIO components in TMS FNC Gantt Chart are designed to enhance your Gantt chart workflow by providing robust export and print capabilities. Let's dive into how these components can help you present your project data professionally and effectively.
Discover all these features and more at the TMS Training Days! I will be hosting a session showcasing the full potential of the TMS FNC Gantt Chart. Don't miss out on this opportunity to learn and engage with our latest tools.
PDFIO and PrintIO
As the name suggests the TTMSFNCGanttChartPDFIO allows you to export your Gantt chart data into a PDF format effortlessly, while the TTMSFNCGanttChartPrintIO component offers a powerful way to print your Gantt chart data directly.
Both of these components are based on the PDF and print functionality available in TMS FNC Core. The features for the Gantt Chart are similar, giving you almost the exact same results for PDF export and direct printing.
These controls have two common properties:
- GanttChart: References the Gantt chart component to be exported.
- GanttChartExportOptions: Customizes layout, appearance, and content settings for the file.
Key Features of the GanttChartExportOptions
Selective Export
Choose to export the task list, timeline, or both with the Mode property, giving you control over the content.
Customizable Appearance
Tailor the appearance with custom colors, fonts, and layout configurations, ensuring that your Gantt chart meets specific aesthetic and branding requirements.
By default the appearance of the Gantt Chart will be used, but with the CustomTaskListAppearance and CustomTimeLineAppearance properties, you can configure each part of the Gantt Chart as you want.
The custom appearances are initialized with grayscale colors to give a clear and simple look.
It is even possible to change the exported columns by name or size, as well as the item height and the unit width, or group and header height from the timeline.
To get even more out of the customization, you can also use the custom drawing events which have a Exporting property in their parameters, indicating if the event is triggered for normal drawing or for the export to PDF or printable pages.
Flexibility
Adjust settings such as page layout and content scaling to ensure the PDF is clear and readable.
How to use
procedure TForm.ExportBtnClick(Sender: TObject); begin pdfIO := TTMSFNCGanttChartPDFIO.Create(nil); pdfIO.GanttChart := YourGanttChart; //Basic PDF Options: pdfIO.Options.OpenInPDFReader := True; pdfIO.Options.PageOrientation := poLandscape; //Part Selection pdfIO.GanttChartPDFExportOptions.Mode := emBoth; //Customization of Appearance: pdfIO.GanttChartPDFExportOptions.UseCustomTaskListAppearance := True; pdfIO.GanttChartPDFExportOptions.CustomTaskListAppearance.HeaderFill.Color := $FF4a4a4a; pdfIO.GanttChartPDFExportOptions.CustomTaskListAppearance.HeaderFont.Color := $FFFFFFFF; pdfIO.GanttChartPDFExportOptions.TaskListBorderDraw := ebRow; pdfIO.GanttChartPDFExportOptions.ItemHeight := 60; pdfIO.GanttChartPDFExportOptions.TimelineUnitWidth := 30; //Select your Columns pdfIO.GanttChartPDFExportOptions.TaskListColumns.AddColumn('taskname','Name', 200); pdfIO.GanttChartPDFExportOptions.TaskListColumns.AddColumn('startdate','Start', 100); pdfIO.GanttChartPDFExportOptions.TaskListColumns.AddColumn('enddate','End', 100); //Other Settings pdfIO.GanttChartPDFExportOptions.FitToPage := True; //Will try to fit everything on one page, otherwise will evenly divide on multiple pages. pdfIO.GanttChartPDFExportOptions.RepeatHeaders := True; pdfIO.Save('.\MyGanttChart.pdf'); Or printIO.Print; end; procedure TForm.YourGanttChartBeforeDrawGanttTimeLineGroupTimeText(Sender: TObject; AGraphics: TTMSFNCGraphics; ADateTime: TDateTime; ARow: Integer; var ADrawingParams: TTMSFNCGanttTimeDrawingParams; var AAllow, ADefaultDraw: Boolean); begin if ADrawingParams.Exporting then begin ADrawingParams.HorizontalAlignment := gtaCenter; end; end;
Conclusion
Both components are invaluable tools for enhancing the versatility and presentation of your Gantt charts. By providing flexible export and print options, these components help you share and present your project data in the most effective way possible.
Explore these components in TMS FNC Gantt Chart and take your project management capabilities to the next level!
Get Started with TMS FNC Gantt Chart Today!
For more information, detailed documentation, and examples, visit the TMS Software website. Enhance your applications with powerful UI components designed to meet your needs.
Gjalt Vanhouwaert
![](img/handwrite_message_24.png)
This blog post has not received any comments yet.
All Blog Posts | Next Post | Previous Post