Scheduler print malfunction for resources

Hello, 

I'm implementing the print functionality for my scheduler but the event slots don't show neither on the preview nor on the generated pdf. This seems to be browser-agnostic. 
I've checked your forum for similar problems but found that the stackblitz examples you shared on these threads don't work for me either.
To sum up here are the problems I'm observing:

- the print doesn't show the events for all resources, 
this is the case for my code and this stackblitz example https://stackblitz.com/edit/angular-timescale-vfre7n?file=src%2Fapp.component.ts,src%2Fapp.component.html given for this forum thread https://www.syncfusion.com/forums/186007/timescale-in-scheduler-print-is-not-working

- the print doesn't show the entirety of the scheduler, the hidden areas that require scrolling don't appear in the print which is problematic. 

this is the case for my code and this stackblitz example https://stackblitz.com/edit/customized-agenda-hvyjje?file=app.component.html  given for this forum thread https://www.syncfusion.com/forums/160125/garbled-print-output-in-agenda-view-with-custom-template 

How do I solve this issue? I made sure I have the latest version of syncfusion, but that doesn't explain why I have the same problems with the online examples. It persists across multiple browsers (chrome, firefox) and multiple operating systems (Linux, Windows)

Thank you in advance for your assistance. Please let me know if you require snippets of my code for better debugging. 
Looking forward to your reply.

Best regards,


Attachment: print_bug_1f3166cb.png

16 Replies 1 reply marked as answer

VR Vijay Ravi Syncfusion Team June 30, 2025 09:54 AM UTC

Hi Tesnim Hamdouni,
 

We have reviewed and validated your reported query. Based on your requirement, you can customize the styles in your application. When printing the schedule, reduce the width of the work cells according to your application’s needs. Refer the below shared style and sample for your reference.

[app.component.css]
 

@media print {

  .e-schedule .e-vertical-view .e-date-header-wrap table col,

  .e-schedule .e-vertical-view .e-content-wrap table col {

    width: 15px;

  }

}


Sample link: https://stackblitz.com/edit/angular-k65fv7ay-pdtswxtz?file=src%2Fapp.component.css

Output screenshot:

 


Don't hesitate to get in touch if you require further help or more information.


Regards,

Vijay


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 


Regards,

Vijay Ravi


Marked as answer

TH Tesnim Hamdouni June 30, 2025 08:30 PM UTC

Hello Vijay, 

Thanks for your swift reply. 

I can see how to fit the scheduler horizontally with the width parameter. However two problems still persist in the example you gave:

- the hours only cover 12am-6am, not the whole day.

- the colors are missing from the print which reduces the schedule's visibility.

Is there a way to get around this? Looking forward to your reply.

Best,



VR Vijay Ravi Syncfusion Team July 1, 2025 06:02 AM UTC

Hi Tesnim Hamdouni,
 

Query 1: The hours only cover 12am-6am, not the whole day.


Based on your requirement, you can set the height in the print options to ensure all time slots are displayed on the print page. Refer to the shared code snippets, sample and output image for your reference.

Sample link: https://stackblitz.com/edit/angular-k65fv7ay-3vvn7ufb?file=src%2Fapp.component.ts

[app.component.ts]
 

public onPrintClick(): void {

    const printOptions: ScheduleModel = {

      width: "auto",

      height: "100%"

    };

    this.scheduleObj.print(printOptions);

  }


Output screenshot:
 


Query 2: The colors are missing from the print which reduces the schedule's visibility.
 

when using the print options, you can enable the "Background Graphics" setting to ensure the appointment colors are displayed instead of appearing in black and white. Please refer to the sample provided below for your reference.

Sample link: https://stackblitz.com/edit/angular-k65fv7ay-3vvn7ufb?file=src%2Fapp.component.ts


 



Don't hesitate to get in touch if you require further help or more information.


Regards,

Vijay



TH Tesnim Hamdouni July 1, 2025 09:40 PM UTC

Hello Vijay,

Thanks again!


I went back to the firststackblitz example and added the height as you noted, but I got this instead:

As you can see in stack1.png, there are no colors despite the print backgrounds option, and some events disappear.


I went back to the second solution you shared to understand the difference. The code is identical save for the height parameter. 

So I removed then added the height field in the onPrintClick() function and got this: as you can see in stack2.png the rest of the events after 6am disappears despite there being a second page.


This behavior is inconsistent and I am not sure if it's due to stackblitz or to the syncfusion package itself. Why would the same code behave differently?


Best,


Attachment: stack2_4244429a.png


VR Vijay Ravi Syncfusion Team July 2, 2025 10:19 AM UTC

Hi Tesnim Hamdouni,
 

Query 1: I went back to the firststackblitz example and added the height as you noted, but I got this instead. As you can see in stack1.png, there are no colors despite the print backgrounds option,
 

You mentioned a StackBlitz sample initially, but it’s unclear whether you’re referring to the sample you shared or the one we shared. However, please try removing the link shared below from the index.html file in the sample and verify if enabling the background graphics results in the correct color display.

[Index.html]
 

<head>

            You can remove these link in index.html

            <!-- <link rel='nofollow' href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" > -->

</head


Sample link: Jkfebnrf (duplicated) - StackBlitz

Query 2: I went back to the second solution you shared to understand the difference. The code is identical save for the height parameter. So I removed then added the height field in the onPrintClick() function and got this: as you can see in stack2.png the rest of the events after 6am disappears despite there being a second page.
 

We have observed that when printing with the configurations specified in our provided sample, the event prints correctly. Kindly verify the sample on your end to confirm if the issue persists. Additionally, it’s possible that your application’s schedule is being overridden by a style other than the default, which may be causing the issue due to additional styles.
 

Please test the sample without any additional styles to ensure the event displays correctly on the print page. If the issue is caused by additional styles, those styles will need to be updated. Should the problem persist, please share a sample that replicates the issue for further investigation.

Sample link: Jkfebnrf (duplicated) - StackBlitz



 
Don't hesitate to get in touch if you require further help or more information.

Regards,

Vijay



TH Tesnim Hamdouni July 6, 2025 07:25 PM UTC

Hello Vijay,

Thank you for your response.

I applied the proposed solutions to my source code, that you will you find attached to this reply.
Unfortunately, when launching the print function, the time slots for the events don't align correctly (date-wise and hour-wise). All-day events that span over two weeks spill over to the adjacent resource.

I attached the relevant source code for the scheduler as well as two test samles for each I included the `_expectations`, ie the scheduler as I see it on the app and the `_print`, ie the print preview. 

How can I fix my code to solve this issue? 

Looking forward to your reply. 


Best,


Attachment: attachments_54c69366.zip


VR Vijay Ravi Syncfusion Team July 7, 2025 01:48 PM UTC

Hi Tesnim Hamdouni,
 

We have reviewed the image attachments you provided and observed that the styles applied during printing do not appear to be correctly reflected, as they are in the application. We have also added the styles you shared to the StackBlitz sample we previously prepared and tested the print functionality, which appears to work correctly without encountering the issue you described. To further investigate your issue, we need to validate it using your sample. Could you please share a sample that replicates the issue or reproduce the issue in our provided StackBlitz sample for further analysis?


Sample link: Jkfebnrf (duplicated) - StackBlitz

Please get back to us with the required details for further assistance.

Regards,

Vijay



TH Tesnim Hamdouni July 8, 2025 10:10 PM UTC

Hello, 

After a deeper investigation, the problem was due to a missing <link rel='nofollow' href="https://cdn.syncfusion.com/ej2/30.1.37/tailwind3.css" rel="stylesheet"/>

Adding it solved the formatting issues of the print preview.

Thanks again for your help.

Have a nice day.

Best,



TH Tesnim Hamdouni July 8, 2025 10:18 PM UTC

I have one final query:

In case of multiple resources (9 in my case), the user needs to zoom out to be able to display all resources in one page (see attached image), making the printed effectively unreadable.

Is there a way to print the schedule's resources in "batches", say 3-4 resources per page?

Much appreciated.


Best,



VR Vijay Ravi Syncfusion Team July 9, 2025 11:26 AM UTC

Hi Tesnim Hamdoun,
 

Is there a method to print the resources of the Syncfusion Scheduler in batches, such as 3-4 resources per page?

 

Currently, there is no direct option to print 3-4 resources per page. The print output is based on the content displayed in the UI viewport. Since you requested to display all resources, you can achieve this by reducing the cell dimensions' width to show all resources and then print. If you need improved readability for appointment details on a specific day, switching to the day view before printing will ensure that only the selected date appears on the print page, providing better readability.

 

Regards,

Vijay



TH Tesnim Hamdouni July 10, 2025 09:04 PM UTC

Hello and thank you for that clarification.


I found a workaround by allowing the user to filter the resources before printing the schedule.
The code works perfectly on my localhost (ng serve).
However when I migrate it to production, styling issues reappear as is shown the print_preview_prod.jpeg image attached.
I'm using (ng build --configration production) and deploying the app using apache.

I've included a proof of concept in the attachment.

Looking forward to your reply.

Best,


Attachment: attachment_cb94c0ea.zip


VR Vijay Ravi Syncfusion Team July 11, 2025 10:09 AM UTC

Hi Tesnim Hamdoun,,
 

We have thoroughly reviewed and validated the query you provided. Our team examined the attachment file you shared, which included the image and sample. We first ran the sample locally in our development environment and confirmed that the styles were applied correctly. Subsequently, we executed the ng build command to generate a production build, and the styles were successfully applied in this environment as well. No issues were encountered with the sample you provided.
 

To ensure optimal performance, we recommend that you include the CDN style link in the styles.css file and verify the results. Additionally, consider adding the !important class to the media print styles and testing the outcome. If the issue persists in the sample you shared, kindly provide detailed steps to replicate the problem for further investigation.
 

@media print {

  .e-schedule .e-vertical-view .e-date-header-wrap table col,

  .e-schedule .e-vertical-view .e-content-wrap table col {

    width: 15px !important;

  }

}
 


Don't hesitate to get in touch if you require further help or more information.

Regards,

Vijay



TH Tesnim Hamdouni July 12, 2025 07:29 PM UTC

Hello and thanks again for your reply.

The error in production was due to style optimizations causing some race conditions when loading the stylesheet.

Disabling the optimization in angular.json solved the issue.
However I noticed that the output was truncated for the second page. I went back to the airway sample you provided above and I noticed it had the same issue, as shown in the attached image.
https://stackblitz.com/edit/angular-k65fv7ay-v6zkwyrx?file=src%2Fapp.component.ts 

My second query concerns the "The included Syncfusion® license key is invalid." banner. I have a valid license key and have the app on production server (hosted vps) and my own machine.

Is there a way to remove this banner on the production server, since it's affecting the user experience?

Looking forward to your reply.

Best,  


Attachment: image_d75fcba8.zip


VR Vijay Ravi Syncfusion Team July 15, 2025 12:19 PM UTC

Hi Tesnim Hamdoun,
 

Query 1: However I noticed that the output was truncated for the second page. I went back to the airway sample you provided above and I noticed it had the same issue, as shown in the attached image.
 

We have reviewed and validated your shared StackBlitz sample. The truncation occurs based on the print page height, as it is the default behavior for printing. Therefore, this cannot be customized in the sample end.


Query 2: My second query concerns the "The included Syncfusion® license key is invalid." banner. I have a valid license key and have the app on production server (hosted vps) and my own machine.

We have branched and created a new forum for the last reported issue. Please follow below ticket for further assistance.

license key is invalid in ... | JavaScript - EJ 2 Forums | Syncfusion®

 

Don't hesitate to get in touch if you require further help or more information.

Regards,

Vijay



TH Tesnim Hamdouni August 3, 2025 09:11 PM UTC

Thank you for your reply


I found a workaround the first query and solved the second one by updating the license key to match the latest version I installed.

I'm reaching out regarding another issue I'm facing.

In my print function, I'm adjusting the time scale of the schedule so that it can fit in one page. Here is a code snippet

public onPrintTimeline(): void {
const printOptions: ScheduleModel = {
width: "auto",
height: "auto",
currentView: 'TimelineWeek',
timeScale: { enable: true, interval: 240, slotCount: 1 }, // 240 interval so that the schedule fits in one A4 page
};
this.scheduler.print(printOptions);
}

The problem is that the events appear shifted out of place when I pick a high interval (180, 240) and in their correct time slots when the interval is 60. (see attachment)

How could I solve this?

Looking forward to your reply.
Best, 
Tesnim


Attachment: screenshots_c7a69902.zip


VR Vijay Ravi Syncfusion Team August 4, 2025 11:49 AM UTC

Hi Tesnim Hamdouni,
 


The issue occurs because the print width option is set to 100%, causing the schedule in the print window to also scale to 100%, adjusting to the available width and impacting the resizing of the work cells. To address this, we recommend setting the width of the schedule in pixels (px) rather than using percentage (%) or auto. This adjustment ensures that appointments are correctly positioned in the print preview.


Sample link: https://stackblitz.com/edit/angular-jiyzk7ct-8teysfk2?file=src%2Fapp.component.ts,src%2Fapp.component.html

[pp.component.ts]
 

public onPrintClick(): void {

    const printOptions: ScheduleModel = {

      width: "1000px",

      height: "auto%",

      currentView: 'TimelineWeek',

      timeScale: { enable: true, interval: 240, slotCount: 1 },

    };

    this.scheduleObj.print(printOptions);

  }


Don't hesitate to get in touch if you require further help or more information.

Regards,

Vijay


Loader.
Up arrow icon