# gantt-exporting

> Gantt chart with export commands for Excel and PDF reports to share project data.

**Framework:** blazor  **Component:** Gantt  **Variant:** exporting

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/blazor/gantt-exporting.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.Blazor.Gantt
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/gantt-exporting/Gantt.razor

```razor
@page "/gantt/exporting"
@namespace blazor.Components.Pages.Exporting.Exporting
@using Syncfusion.Blazor.Gantt

<div class="control-section" aria-label="Gantt with export toolbar">
    <SfGantt TValue="ExportingTask" @ref="GanttRef" Height="420px" RowHeight="46" TaskbarHeight="25"
             TreeColumnIndex="1" DataSource="@Tasks" ProjectStartDate="new DateTime(2025, 4, 1)"
             ProjectEndDate="new DateTime(2025, 8, 31)" Toolbar="@(new List<string>() { "Search", "ExpandAll", "CollapseAll", "ExcelExport", "CsvExport", "PdfExport" })">
        <GanttTaskFields Id="TaskId" Name="TaskName" StartDate="StartDate" EndDate="EndDate"
                          Duration="Duration" Progress="Progress" Dependency="Predecessor" ParentID="ParentID">
        </GanttTaskFields>
        <GanttColumns>
            <GanttColumn Field="TaskId" Width="80"></GanttColumn>
            <GanttColumn Field="TaskName" HeaderText="Task" Width="250"></GanttColumn>
            <GanttColumn Field="StartDate" Width="120"></GanttColumn>
            <GanttColumn Field="Duration" Width="100"></GanttColumn>
            <GanttColumn Field="Progress" Width="100"></GanttColumn>
        </GanttColumns>
        <GanttLabelSettings TValue="ExportingTask" LeftLabel="TaskName" RightLabel="Progress"></GanttLabelSettings>
        <GanttSplitterSettings ColumnIndex="2"></GanttSplitterSettings>
    </SfGantt>
</div>

@code {
    public SfGantt<ExportingTask>? GanttRef { get; set; }
    public List<ExportingTask> Tasks { get; set; } = new List<ExportingTask>();

    protected override void OnInitialized()
    {
        Tasks = new List<ExportingTask>
        {
            new ExportingTask { TaskId = 1, TaskName = "Plan and design", StartDate = new DateTime(2025, 4, 1),  EndDate = new DateTime(2025, 4, 14), Duration = 10, Progress = 100 },
            new ExportingTask { TaskId = 2, TaskName = "Build prototype", StartDate = new DateTime(2025, 4, 15), EndDate = new DateTime(2025, 5, 5),  Duration = 15, Progress = 80, ParentID = 1 },
            new ExportingTask { TaskId = 3, TaskName = "Beta testing",    StartDate = new DateTime(2025, 5, 6),  EndDate = new DateTime(2025, 5, 26), Duration = 15, Progress = 40, Predecessor = "2" },
            new ExportingTask { TaskId = 4, TaskName = "Public launch",   StartDate = new DateTime(2025, 5, 27), EndDate = new DateTime(2025, 6, 10), Duration = 10, Progress = 0,  Predecessor = "3" },
        };
    }

    public class ExportingTask
    {
        public int TaskId { get; set; }
        public string TaskName { get; set; } = string.Empty;
        public DateTime StartDate { get; set; }
        public DateTime EndDate { get; set; }
        public int Duration { get; set; }
        public int Progress { get; set; }
        public int ParentID { get; set; }
        public string Predecessor { get; set; } = string.Empty;
    }
}

```
