Scheduler client PDF export with ClientExportManager

1 posts, 0 answers
  1. Peter
    Peter avatar
    12 posts
    Member since:
    Jan 2017

    Posted 02 Nov 2017 Link to this post

    Requirements

    Telerik Product and Version

    UI for ASP.NET AJAX 2019 R1

    Supported Browsers and Platforms

    all browsers supported by Telerik UI for ASP.NET AJAX suite

    Components/Widgets used (JS frameworks, etc.)

    RadScheduler, RadClientExportManager, .NET 4.0/4.5 C#

    PROJECT DESCRIPTION

    This project demonstrates how to export the Scheduler to PDF on the client-side by using the ClientExportManager control. 

    <style>
        body {
            font-size: 14px;
        }
     
        .k-pdf-export .rsToolbar.rsNav .p-icon:before,
        .k-pdf-export .p-icon.p-i-recurrence:before {
            position: absolute;
            margin-top: -10px;
        }
     
        .k-pdf-export .p-icon:before {
            position: absolute;
        }
    </style>

    <telerik:RadClientExportManager ID="RadClientExportManager1"
        runat="server" OnClientPdfExported="onClientPdfExported">
    </telerik:RadClientExportManager>
      
    <telerik:RadButton ID="RadButton1"
        RenderMode="Lightweight"
        runat="server"
        OnClientClicked="exportScheduler"
        Text="Export RadScheduler"
        AutoPostBack="false"
        UseSubmitBehavior="false">
    </telerik:RadButton>

    <script>
         
        function exportScheduler(sender, args) {
            var scheduler = $find("<%= RadScheduler1.ClientID %>");
            scheduler.__originalHeight = scheduler.get_height();
            // remove height so that there is no scroll in the exported file
            scheduler.set_height("");
      
            $find('<%=RadClientExportManager1.ClientID%>').exportPDF($telerik.$(scheduler.get_element()));
        }
      
        function onClientPdfExported() {
            var scheduler = $find("<%= RadScheduler1.ClientID %>");
            // restore the original height after the Scheduler is exported
            scheduler.set_height(scheduler.__originalHeight);
        }
    </script>


Back to Top