# gantt-exporting

> Gantt chart with toolbar commands for exporting project data to Excel and PDF formats.

**Framework:** aspnet-core  **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/aspnet-core/gantt-exporting.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.AspNetCore.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.cshtml

```cshtml
@page
@namespace aspnet_core.Gantt.Exporting
@model EJ2CoreSampleBrowser.Gantt.Exporting.ExportingModel
@using Syncfusion.EJ2
@using Syncfusion.EJ2.Gantt

    <div class="control-section">
        <div class="row">
            <div class="col-md-12">
                <ejs-gantt id='Exporting' dataSource="@Model.DataSource" height="420px" rowHeight="46"
                    taskbarHeight="25" treeColumnIndex="1" highlightWeekends="true"
                    projectStartDate="2025-04-01" projectEndDate="2025-08-31"
                    toolbarItems="@(new List<string>() { "Search", "ExpandAll", "CollapseAll", "ExcelExport", "CsvExport", "PdfExport" })">
                    <e-gantt-taskfields id="TaskId" name="TaskName" startDate="StartDate" endDate="EndDate" duration="Duration"
                        progress="Progress" dependency="Predecessor" parentID="ParentID">
                    </e-gantt-taskfields>
                    <e-gantt-columns>
                        <e-gantt-column field="TaskId" width="80"></e-gantt-column>
                        <e-gantt-column field="TaskName" headerText="Task" width="250" clipMode="EllipsisWithTooltip"></e-gantt-column>
                        <e-gantt-column field="StartDate"></e-gantt-column>
                        <e-gantt-column field="Duration"></e-gantt-column>
                        <e-gantt-column field="Progress"></e-gantt-column>
                    </e-gantt-columns>
                    <e-gantt-splittersettings columnIndex="2"></e-gantt-splittersettings>
                    <e-gantt-labelSettings leftLabel="TaskName"></e-gantt-labelSettings>
                </ejs-gantt>
            </div>
        </div>
    </div>

```

### src/components/gantt-exporting/gantt.cshtml.cs

```cs
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace EJ2CoreSampleBrowser.Gantt.Exporting
{
    public class ExportingModel : PageModel
    {
        public List<ExportingTask> DataSource { get; set; }

        public void OnGet()
        {
            DataSource = 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; }
        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; }
    }
}

```
