Export PDF with different user colors

Can i export a PDF with colors like these? 


I can export one like this way - But i need colors for single users


I'm giving properties like this way for the resources-



Thank you

Schedule Control - 

    <ej:Schedule StartHour="8" EndHour="18" ShowQuickWindow="true" ShowLocationField="true" ShowAppointmentNavigator="false" Navigation="onNavigation" AppointmentWindowOpen="onAppointmentOpen" BeforeAppointmentRemove="BeforeAppointmentRemove" ResizeStop="ResizeStop" DragStop="DragStop" EnableLoadOnDemand="true" OnServerExportPDF="Schedule1_OnServerExportPDF" OnExportToExcel="Schedule1_ServerExportExcel" ClientIDMode="Static" runat="server" ID="Schedule1" Width="100%" CellHeight="60px" CellWidth="120px" CurrentView="Workweek" Orientation="Horizontal" ShowCurrentTimeIndicator="false">


        <TimeScale Enable="true" MajorSlotTemplateId="#majorTemplate" />

        <AgendaViewSettings DaysInAgenda="5" />


        <ReminderSettings Enable="true" AlertBefore="10" />

        <TooltipSettings Enable="True"></TooltipSettings>

        <PrioritySettings Enable="true" Text="text" Value="value"></PrioritySettings>

        <Resources>

            <ej:Resources Field="Categorize" Name="Categorize" Title="Departments" AllowMultiple="true">

                <ResourceSettings Color="color" Id="id" Text="text">

                </ResourceSettings>

            </ej:Resources>

            <ej:Resources Field="Owner" Name="Owner" Title="Users" AllowMultiple="true">

                <ResourceSettings Color="color" Id="id" Text="text" GroupId="groupId">

                </ResourceSettings>

            </ej:Resources>


        </Resources>

        <Group Resources="Categorize,Owner" />


        <DataManager CrossDomain="true" URL="Comm_Calander.aspx/Data" CrudURL="Syncfusion_Scheduler_WebService.asmx/CrudResult" InsertURL="Syncfusion_Scheduler_WebService.asmx/InsertData" UpdateURL="Syncfusion_Scheduler_WebService.asmx/UpdateData" RemoveURL="Syncfusion_Scheduler_WebService.asmx/RemoveData" Adaptor="UrlAdaptor" />

        <AppointmentSettings Id="Id" ResourceFields="Categorize,Owner" Subject="Subject" AllDay="AllDay" Priority="Priority" StartTime="StartTime" EndTime="EndTime" Description="Description" Recurrence="Recurrence" RecurrenceRule="RecurrenceRule" StartTimeZone="StartTimeZone" EndTimeZone="EndTimeZone" />

    </ej:Schedule>


6 Replies

RV Ravikumar Venkatesan Syncfusion Team August 5, 2022 05:40 PM UTC

Hi Kavishka,


Greetings from Syncfusion support.


We have validated your query “Export PDF with different user colors” at our end. You can print the Schedule with the individual resource colors by removing the color field from the parent-level resource settings and keeping the color field in the child-level resource settings as highlighted below. We have prepared a sample for your reference.


[Default.aspx]

        <ej:Schedule ID="Schedule2">

            <resources>

                <ej:Resources Field="Categorize" Name="Categorize" Title="Departments" AllowMultiple="true">

                    <resourcesettings id="id" text="text">

                    </resourcesettings>

                </ej:Resources>

                <ej:Resources Field="Owner" Name="Owner" Title="Users" AllowMultiple="true">

                    <resourcesettings color="color" id="id" text="text" groupid="groupId">

                    </resourcesettings>

                </ej:Resources>

            </resources>

            <group resources="Categorize,Owner" />

       </ej:Schedule>


Kindly let us know if you need any further assistance on this.


Regards,

Ravikumar Venkatesan

If this post is helpful, kindly consider accepting it as the solution so that other members can locate it more quickly.


Attachment: ejwebformsschedulepdfexportwithresourcecolors_61ff96b.zip


KS Kavishka Subashana August 7, 2022 09:31 AM UTC

Thank you, It worked well,

But I'm having some other issues,

1) If I use the control with 'StartHour' and 'EndHour' Propeties, The exported PDF view is getting wrong time. If I remove  'StartHour' and 'EndHour' Propeties its working fine.


The Scheduler View -


The PDF View for this with StartHour and Endhour Properties - 



2) If I created a meeting for 2 days PDF view is getting something like this -

The 'Test 2 day long' Meeting - 



This is the exported PDF for this - 



I hope I supplied necessary information.

Thank you so much. 




RV Ravikumar Venkatesan Syncfusion Team August 8, 2022 04:31 PM UTC

Hi Kavishka,


We have validated your reported issue at our end and confirmed this as a bug and logged the defect report "Appointments are misplaced on pdf export with StartHour and EndHour properties of the Schedule" which can be tracked from the following link.


https://www.syncfusion.com/feedback/36907/appointments-are-misplaced-on-pdf-export-with-starthour-and-endhour-properties-of


The fix for this defect will be included in our upcoming main release which is expected to be rolled out by the end of September 2022. We would appreciate your valuable patience until then.


Kindly let us know if you need any further assistance.


Regards,

Ravikumar Venkatesan



KS Kavishka Subashana August 12, 2022 09:57 AM UTC

Thank you, I'm getting another question about same user in resources more than once.

I'm having same user assigned for different departments, After I create an appointment for a user and Export a PDF, Every user who duplicated have the same appointment.


Exported PDF - 


More names also available in the exported PDF but cant see in the scheduler - They are filtered using this 


But in the PDF its coming.

Thank you 



RV Ravikumar Venkatesan Syncfusion Team August 17, 2022 03:59 PM UTC

Hi Kavishka,


Q1: I'm having same user assigned for different departments, After I create an appointment for a user and Export a PDF, Every user who duplicated have the same appointment.

We suspect that you have used the same id for the resource under a different group. So, we suggest you use the unique id for each resource to avoid duplicate appointment problems in the exported pdf.


[Default.aspx.cs]

        protected void Page_Load(object sender, EventArgs e)

        {

            departments.Add(new Resource { text = "Administration", id = "1", color = "#f8a398" });

            departments.Add(new Resource { text = "Public Works", id = "2", color = "#56ca85" });

            departments.Add(new Resource { text = "Abilene Police Dept", id = "3", color = "#51a0ed" });

 

            users.Add(new Resource { text = "Kari Zook", id = "1", color = "#ff8787", groupId = "1" });

            users.Add(new Resource { text = "Marcus RothChild", id = "2", color = "#9775fa", groupId = "1" });

            users.Add(new Resource { text = "Kari Zook", id = "9", color = "#ff8787", groupId = "2" });

 

            Schedule2.Resources[0].ResourceSettings.DataSource = departments;

            Schedule2.Resources[1].ResourceSettings.DataSource = users;

        }


Q2: More names also available in the exported PDF but cant see in the scheduler - They are filtered using this

You can print the specific resources by filling out the resources and updating the resources property of the Schedule while exporting the pdf as shown in the below code snippet.


[Default.aspx]

    <script type="text/javascript">

        var appointmentGroupId = 0;

        function onExportClick(args) {

            var obj = $("#Schedule2").data("ejSchedule");

            if (obj) {

                var categoryData = obj.model.resources[0].resourceSettings.dataSource;

                obj.model.resources[0].resourceSettings.dataSource = obj.model.resources[0].resourceSettings.dataSource.filter((e) => { return e.id == '1' });

                var owerData = obj.model.resources[0].resourceSettings.dataSource;

                obj.model.resources[1].resourceSettings.dataSource = obj.model.resources[1].resourceSettings.dataSource.filter((e) => { return e.groupId == '1' });

                obj.exportSchedule(null, "exportPDF", null);

                obj.model.resources[0].resourceSettings.dataSource = categoryData;

                obj.model.resources[1].resourceSettings.dataSource = owerData;

            }

        }

   </script>


Kindly try the shared solution and let us know if you need any further assistance on this.


Regards,

Ravikumar Venkatesan

If this post is helpful, kindly consider accepting it as the solution so that other members can locate it more quickly.


Attachment: ejwebformsschedulepdfexportcustomization_dd47d362.zip


RV Ravikumar Venkatesan Syncfusion Team September 29, 2022 02:57 PM UTC

Hi Kavishka,


Thanks for being patience.


We are glad to announce that our Essential Studio 2022 Volume 3 release v20.3.0.47 is rolled out and is available for download under the following link. In this release, appointments are misplaced on pdf export with StartHour and EndHour properties of the Schedule have been fixed. As a result, we recommend you upgrade to the latest version of our Syncfusion packages to avail yourself of those changes.


https://www.syncfusion.com/forums/177858/essential-studio-2022-volume-3-main-release-v20-3-0-47-is-available-for-download

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/ej-webforms-schedule-export-pdf-sample-517222173


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Regards,

Ravikumar Venkatesan


Loader.
Up arrow icon