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

Export to PDF for MVC Diagram does not work

1 Answer 63 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Sanjukta
Top achievements
Rank 1
Sanjukta asked on 23 Aug 2018, 08:19 PM

Hi Team,

      I was trying to export the diagram to pdf, but it shows error.

Please help.

Razor Code :

@using Kendo.Mvc.UI<br>@{<br>    ViewBag.Title = "Workflow Chart";<br>}
<p><br><script src="https://kendo.cdn.telerik.com/2017.3.913/js/pako_deflate.min.js"></script></p><p><button class="btn btn-primary" id="btnExportPdf">Export to PDF</button></p><p>@(Html.Kendo().Diagram()<br>                            .Name("workflowOverviewDiagram")<br>                            .Pdf(pdf => pdf<br>              .FileName("KendoUIDiagramExport.pdf")<br>              .ProxyURL(Url.Action("Pdf_Export_Save", "WorkflowMaintenance", new { area = "Maintenance"}))<br>          )<br>                            .DataSource(dataSource => dataSource<br>                            .Read(read => read.Action("GetWorkflowStopData", "WorkflowMaintenance", new { area = "Maintenance", workflowDefinitionId = Model.OtcId }))<br>                            .Model(m => m.Children("Items"))<br>                            )<br>                            .Editable(false)<br>                            .Layout(l => l<br>                                        .HorizontalSeparation(400)<br>                                        .VerticalSeparation(200)<br>                                        .Type(DiagramLayoutType.Tree).Subtype(DiagramLayoutSubtype.Down)<br>                            )<br>                            .ShapeDefaults(sd => sd.Visual("visualTemplate"))<br>                            .ConnectionDefaults(cd => cd<br>                                .EndCap("ArrowEnd")<br>                                .Stroke(s => s<br>                                .Color("#979797")<br>                            )<br>                            )<br>                            .ZoomRate(0)<br>                            .Selectable(false)<br>                            .Events(events => events.DataBound("onDataBound"))<br><br>)</p><p><script></p><p>$("#btnExportPdf").click(function () {<br>        $("#workflowOverviewDiagram").getKendoDiagram().saveAsPDF();<br>    });</p><p></script></p>

Error :

kendo.all.js:52580 Uncaught Error: Cannot output NaN to PDF
    at e (VM4745 kendo.all.min.js:52)
    at VM4745 kendo.all.min.js:52
    at Function.e.withIndent (VM4745 kendo.all.min.js:52)
    at D (VM4745 kendo.all.min.js:52)
    at e (VM4745 kendo.all.min.js:52)
    at Function.e.indent (VM4745 kendo.all.min.js:52)
    at VM4745 kendo.all.min.js:53
    at Function.e.withIndent (VM4745 kendo.all.min.js:52)
    at z.render.render (VM4745 kendo.all.min.js:53)
    at e (VM4745 kendo.all.min.js:52)

 

 

1 Answer, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 28 Aug 2018, 07:31 AM
Hello,

I tried to replicate the unwanted behavior using the provided setup, but to no avail. Can you reproduce the same problem on our online example? In case some specific configuration is needed, please modify it or isolate a small runnable project, which demonstrates the issue. 

Regards,
Milena
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Diagram
Asked by
Sanjukta
Top achievements
Rank 1
Answers by
Milena
Telerik team
Share this question
or