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

RadScheduler PDF appointments not using StyleSheets

3 Answers 55 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Benjamin
Top achievements
Rank 1
Benjamin asked on 06 Jun 2018, 04:00 PM

     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

3 Answers, 1 is accepted

Sort by
0
Accepted
Peter Milchev
Telerik team
answered on 11 Jun 2018, 12:46 PM
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.
0
Benjamin
Top achievements
Rank 1
answered on 11 Jun 2018, 05:05 PM

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("");

 

 

0
Peter Milchev
Telerik team
answered on 15 Jun 2018, 08:00 AM
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.
Tags
Scheduler
Asked by
Benjamin
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Benjamin
Top achievements
Rank 1
Share this question
or