Table of Contents

Getting started with TMS FNC Gantt Chart PDF IO

TTMSFNCGanttChartPDFIO exports a Gantt chart to a PDF file. This page produces a PDF in a few lines; the Guides cover export modes, column selection, and page breaks.

Prerequisites

  • TMS FNC Core installed, including the PDF library.
  • TMS FNC Gantt Chart installed and its runtime package referenced.
  • A configured TTMSFNCGanttChart on the form with tasks loaded.

Add the component

  1. Drop a TTMSFNCGanttChartPDFIO from the TMS FNC Gantt Chart palette page onto the form.
  2. Assign the chart and export:
procedure TForm1.ExportToPDF;
begin
  GanttChartPDFIO1.GanttChart := GanttChart1;

  // Export the task list, the timeline, or both.
  GanttChartPDFIO1.GanttChartPDFExportOptions.Mode := emBoth;

  // Choose the task-list columns and their widths.
  GanttChartPDFIO1.GanttChartPDFExportOptions.TaskListColumns.Clear;
  GanttChartPDFIO1.GanttChartPDFExportOptions.TaskListColumns.AddColumn('wbs', 'WBS', 80, 60);
  GanttChartPDFIO1.GanttChartPDFExportOptions.TaskListColumns.AddColumn('taskname', 'Task', 160, 120);
  GanttChartPDFIO1.GanttChartPDFExportOptions.TaskListColumns.AddColumn('startdate', 'Start', 90, 70);
  GanttChartPDFIO1.GanttChartPDFExportOptions.TaskListColumns.AddColumn('duration', 'Duration', 90, 70);

  // Fit the timeline to the page and repeat headers on every page.
  GanttChartPDFIO1.GanttChartPDFExportOptions.FitToPage := True;
  GanttChartPDFIO1.GanttChartPDFExportOptions.RepeatHeaders := True;

  GanttChartPDFIO1.Options.PageOrientation := poLandscape;
  GanttChartPDFIO1.Options.OpenInPDFReader := True;

  GanttChartPDFIO1.Save('project.pdf');
end;

Save writes the PDF synchronously; Options.OpenInPDFReader := True launches it afterward.

Next steps

  • Guides — export modes, task-list columns, fit-to-page, and page breaks.
  • API reference — full class reference for TTMSFNCGanttChartPDFIO.