This is a migrated thread and some comments may be shown as answers.

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

3 Answers 190 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 13 Apr 2016, 10:08 PM
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.

3 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 18 Apr 2016, 07:28 AM
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
0
Sean
Top achievements
Rank 1
answered on 18 Apr 2016, 07:42 AM
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!
0
Ivan Danchev
Telerik team
answered on 20 Apr 2016, 11:53 AM
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
Tags
Gantt
Asked by
Sean
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Sean
Top achievements
Rank 1
Share this question
or