Gantt export to PDF - Only export the viewable area or subset of columns

4 posts, 0 answers
  1. Sean
    Sean avatar
    4 posts
    Member since:
    Dec 2012

    Posted 13 Apr Link to this post

    Some of our projects are very long, and our users would like to export just what is viewable on page web page to PDF. So, it would essentially be a narrow sliver of the entire Gantt chart, but every task (row) would be show. For example, show only a Gantt chart for the next 2 months of tasks, instead of the entire project. We thought about just pulling in a subset of tasks, but then we need to handle things like tasks that included in the next 2 months, then changing their start and end dates accordingly. However, we were hoping there was an easier way to set the start and end date of the entire Gantt chart so we can export just the time frame we are focusing on.
  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    837 posts

    Posted 18 Apr Link to this post

    Hello Sean,

    Could you specify the product you are using, whether it is RadGantt for ASP.NET AJAX as set in the thread's info or Kendo UI Gantt as shown in the screenshot you attached? If you are using Kendo Gantt you could export the visible part of the Timeline View using the corresponding classes (highlighted in yellow below) and kendo drawing, for example:
    function onClick(e) {
        var drawing = kendo.drawing;
        drawing.drawDOM(".k-timeline > .k-grid-content").then(function (group) {
            group.options.set("pdf");
            drawing.pdf.saveAs(group, "filename.pdf");
        });
    }

    Alternatively, if you are using RadGantt for ASP.NET AJAX, the ClientExportManager is the control that can export specific elements on the page.

    Regards,
    Ivan Danchev
    Telerik
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sean
    Sean avatar
    4 posts
    Member since:
    Dec 2012

    Posted 18 Apr in reply to Ivan Danchev Link to this post

    Thanks so much for the help. Sorry I had the screen shot mixed up, we are using the ajax version of the Gantt control. I think the client export manager is good direction for us and I'm sure we will get it to work. Thanks again!
  5. Ivan Danchev
    Admin
    Ivan Danchev avatar
    837 posts

    Posted 20 Apr Link to this post

    Hello Sean,

    Thank you for specifying the product you are using.

    The RadGantt for ASP.NET AJAX uses different classes compared to the Kendo Gantt so here's how you can export the visible part of its Timeline view using the ClientExportManager:
    <div>
        <input type="button" onclick="exportElement()" value="export" />
     
        <telerik:RadClientExportManager runat="server" ID="RadClientExportManager1">
            <PdfSettings FileName="MyFile.pdf" />
        </telerik:RadClientExportManager>
    </div>
     
    <script type="text/javascript">
        function exportElement() {
            var exp = $find("<%=RadClientExportManager1.ClientID%>");
            exp.exportPDF($telerik.$(".rgtTimelineContent"));
        }
    </script>


    Regards,
    Ivan Danchev
    Telerik
Back to Top