Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #101723
    Anonymous
    Inactive
    Up
    0
    Down

    Hi,
    I have a question on export data of Gantt chart. It’s possible to export field not visible in task columns? In task columns I have defined only four columns, but in the export I want to show other columns, it’s possible to choose the visible column in the export?
    Thanks in advance.
    Walter

    #101724
    yavordashew
    Member
    Up
    0
    Down

    Hi Walter,
    Let me give you a solution that my suit your needs.
    If you want to add new task columns when export the Gantt chart you can do so by pushing new task column object to the taskColumns array.
    I have prepared a little code example to showcase you this functionality:
    //In your HTML file:

      <smart-gantt-chart view="day"></smart-gantt-chart>
        <div class="option">
                <smart-button id="exportToPDF">Export to PDF</smart-button>
        </div>
    

    //In your Js file:

        let newTaskColumn =   {
            label: 'Date End',
            value: 'dateEnd',
            size: '25%',
            min: '20%'
        };
        const ganttChart = document.querySelector('smart-gantt-chart');
        document.getElementById('exportToPDF').addEventListener('click', function (event) {
            ganttChart.taskColumns.push(newTaskColumn);
            ganttChart.refresh(true,false);
            ganttChart.exportData('pdf');
        });
    

    Let me know if that works for you.
    Please, do not hesitate to contact us if you have any additional questions.
    Best regards,
    Yavor Dashev
    Smart UI Team
    https://www.htmlelements.com/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.