RadScheduler PDF appointments not using StyleSheets

4 posts, 1 answers
  1. Benjamin
    Benjamin avatar
    3 posts
    Member since:
    May 2018

    Posted 06 Jun 2018 Link to this post

         Hello-

    I am using RadScheduler with the following options:

    <telerik:RadScheduler runat="server" ID="RadSchedulerControl" 
        SelectedView="MonthView"
        OverflowBehavior="Expand" 
        ReadOnly="true" 
        ShowHoursColumn="false" 
        ShowViewTabs="false" 
        MonthView-VisibleAppointmentsPerDay="4" 
        NumberOfHoveredRows="0"
        >
        <AppointmentTemplate>
            <a id="calItem" class='<%#Eval("ButtonClass")%> tipme' title="" href='<%#Eval("SubjectLink")%>' data-tooltipurl='<%# Eval("ToolTipUrl")%>' style="width:100%;white-space:inherit;" ><%# Eval("Subject")%></a>    <!--white-space:inherit allows button text wrap-->  
        </AppointmentTemplate>
        <ExportSettings>
            <Pdf StyleSheets="http://localhost:58582/styles/site.css, http://localhost:58582/styles/bootstrap.min.pagereports.css"/>
        </ExportSettings>
    </telerik:RadScheduler>

    The issue is that appointments are not using the styles listed in ExportSettings.  I know this because they are the wrong color and appointment text is truncated.  I have tried both relative paths and full paths.  What do I need to do differently?  Thanks!

    Ben

  2. Answer
    Peter Milchev
    Admin
    Peter Milchev avatar
    613 posts

    Posted 11 Jun 2018 Link to this post

    Hello Ben,

    We have tested this scenario and the styles are loaded and applied correctly. Attached is the sample project we used to test this scenario. 

    The server-side PDF export requires the Scheduler to be in Classic render mode and if you are loading styles for the Lightweight RenderMode of the Scheduler, it is expected that they are not applied - https://docs.telerik.com/devtools/aspnet-ajax/controls/scheduler/export/pdf/overview: In order to work appropriately, the PDF Export functionality requires the RadScheduler to be in Classic render mode. This is because, internally, a .NET WebBrowser is used to take a snapshot image of the RadScheduler, which is then wrapped in a PDF document. That browser does not support Lightweight rendering, so the RadScheduler must be in Classic render mode

    If you are using the Lightweight render mode, I recommend using the ClientExportManager to export the Scheduler to PDF: Scheduler client PDF export with ClientExportManager.

    Regards,
    Peter Milchev
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Benjamin
    Benjamin avatar
    3 posts
    Member since:
    May 2018

    Posted 11 Jun 2018 Link to this post

    Thanks!  I was able to get it working using the ClientExportManager.  

    I had to remove these three lines, though.  I don't know why but $find("RadScheduler1") returns null.  I even renamed my telerik:RadScheduler to RadScheduler1 thinking maybe the ID I used caused some sort of conflict.  Anyway it seems to work without setting the height.  What issues will not setting it cause?

    //scheduler = $find("RadScheduler1");
    //height = scheduler.get_height();
    //scheduler.set_height("");

     

     

  4. Peter Milchev
    Admin
    Peter Milchev avatar
    613 posts

    Posted 15 Jun 2018 Link to this post

    Hello Ben,

    The height code is used for scenarios where the Scheduler has a scroll and this code expands it so that all the content is exported in the PDF. 

    Regarding the scheduler reference, getting the reference by using the correct client-side ID of the control would work. You can get the Client-side Reference to a Control Object as explained in this article: https://docs.telerik.com/devtools/aspnet-ajax/general-information/get-client-side-reference.

    Regards,
    Peter Milchev
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top