Print scheduler. Show all appointments in month view

Hi there i want to print pdf version of a scheduler

If i print the week view i have two pages and i don't like it 

If i show month view i see only one appointment. 

Do you have a suggesto for me, plea


1 Reply

SR Swathi Ravi Syncfusion Team November 19, 2024 01:43 PM UTC

Hi Francesco Pruneri,

Thank you for reaching out to us.

Q1: If I print the week view, I have two pages.

To ensure the week view fits within a single page, you can reduce the height of the work cells. Here is an example of how to achieve this:

@using Syncfusion.Blazor.Schedule
@using Syncfusion.Blazor.Buttons

<SfButton OnClick="OnPrintClick">Print</SfButton>

<SfSchedule @ref="ScheduleRef" CssClass="@CssClass" TValue="AppointmentData" @bind-SelectedDate="@CurrentDate" EnableAutoRowHeight="true"></SfSchedule>

@code {
    SfSchedule<AppointmentData> ScheduleRef;
    public string CssClass = "print-scheduler";
    DateTime CurrentDate = new DateTime(2020, 3, 10);

    public async void OnPrintClick()
    {
        await ScheduleRef.PrintAsync();
    }
}

<style>
    .print-scheduler.e-schedule .e-vertical-view .e-time-cells-wrap table td,
    .print-scheduler.e-schedule .e-vertical-view .e-work-cells {
        height: 29px;
    }
</style>


Q2: If I show the month view, I see only one appointment. 

If you have multiple appointments on a single date (e.g., November 19) but only one is displayed in the printed output, you can enable the EnableAutoRowHeight property to ensure all appointments are visible in the month view. Here's how:

<SfSchedule @ref="ScheduleRef" CssClass="@CssClass" TValue="AppointmentData"  EnableAutoRowHeight="true"></SfSchedule>


Regards,
Swathi

Attachment: schedulerprint_30021937.zip

Loader.
Up arrow icon