Scheduler printing

Hi folks,
got a few questions/issues re printing of a schedule. I used the linked stackblitz example https://stackblitz.com/edit/print-schedule as printing is not covered in the ej2 scheduler documentation.

1. Stackblitz sample seems to have an issue with the "ItemModel" type def, which seems to come from another module (angular-navigation). Do I need to instalkl that module?
2. Print icon does not show in stackblitz sample and I get the same effect.
3. Just to confirm: The scheduler does not have a toolbar property like the grid component? So I need to use the inject method ........
4. Printing itself does work, but the printout is not reflecting my custom event templates and custom work-cell styling..... Is there a way to achieve this? 

Thx a lot for your help
Julius

5 Replies 1 reply marked as answer

RV Ravikumar Venkatesan Syncfusion Team November 17, 2020 03:06 PM UTC

Hi Julius, 

Greetings from Syncfusion support. 


Do I need to install “@syncfusion/ej2-angular-navigations”module? 

Yes, we need to install the navigations package to use the ItemModel. We have used the toolbar component in our Schedule. So, if we need to add a custom item to the Schedule toolbar. We need to install this package to use the ItemModel

 
The print icon does not show in stackblitz sample and I get the same effect 

We have prepared a Schedule sample that contains the print icons in the toolbar and we have achieved it with the help of the CSS styles shown below. 

[app.component.css] 
@font-face { 
  font-family: "Schedule_print"; 
  src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMjhtRPcAAAEoAAAAVmNtYXDiGOJwAAABnAAAAEBnbHlmSXIhowAAAewAAAacaGVhZBR10/MAAADQAAAANmhoZWEIRwQIAAAArAAAACRobXR4HAAAAAAAAYAAAAAcbG9jYQUwBn4AAAHcAAAAEG1heHABGQC2AAABCAAAACBuYW1lBOSmewAACIgAAAKdcG9zdMbb77wAAAsoAAAAaQABAAAEAAAAAFwEAAAAAAAD6gABAAAAAAAAAAAAAAAAAAAABwABAAAAAQAAyBsHLV8PPPUACwQAAAAAANi2x4EAAAAA2LbHgQAAAAAD6gP0AAAACAACAAAAAAAAAAEAAAAHAKoACAAAAAAAAgAAAAoACgAAAP8AAAAAAAAAAQQAAZAABQAAAokCzAAAAI8CiQLMAAAB6wAyAQgAAAIABQMAAAAAAAAAAAAAAAAAAAAA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BzAGkAbgBnACAAUwB5AG4AYwBmAHUAcwBpAG8AbgAgAE0AZQB0AHIAbwAgAFMAdAB1AGQAaQBvAHcAdwB3AC4AcwB5AG4AYwBmAHUAcwBpAG8AbgAuAGMAbwBtAAAAAAIAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwECAQMBBAEFAQYBBwEIAAhNVF9Bc3luYwhNVF9Ub2RheQdNVF9XZWVrB01UX1llYXIKcHJpbnRlci0wMQhNVF9tb250aAAAAAAA) 
    format("truetype"); 
  font-weight: normal; 
  font-style: normal; 
} 
.schedule-print.e-schedule .e-schedule-toolbar .e-icons { 
  font-family: "Schedule_print", "e-icons"; 
} 
 
.schedule-print.e-schedule .e-schedule-toolbar .e-icon-schedule-print::before { 
  content: "\e204"; 
} 


The scheduler does not have a toolbar property like the grid component? 

Currently, our Schedule doesn’t have the property like the grid component. So, we can only add the custom items to the toolbar in the actionBegin event of the Schedule as shown in the below code. 

[app.component.ts] 
  public onActionBegin(args: ActionEventArgs & ToolbarActionArgs): void { 
    if (args.requestType === "toolbarItemRendering") { 
      const exportItem: ItemModel = { 
        align: "Right", 
        showTextOn: "Both", 
        prefixIcon: "e-icon-schedule-print", 
        text: "Print", 
        cssClass: "e-print", 
        click: this.onPrintIconClick.bind(this) 
      }; 
      args.items.push(exportItem); 
    } 
  } 


Printout is not reflecting my custom event templates and custom work-cell styling. Is there a way to achieve this? 

We suspect that the colors are applied to the cellTemplate and eventTemplate are not available when printing. To print these templates are available with the colors when printing we need to enable the Background Graphics option in the browser as shown in the below snip. 


 



Kindly try the above sample and get back to us if you need any further assistance. 

Regards, 
Ravikumar Venkatesan 



JP Julius Peter November 17, 2020 10:25 PM UTC

Hi Ravikumar,
thx for your quick reply. Your hint re background graphics for the schedule printing works like a charm.
Even with your sample I have not been able to display the print icon. Txt and button functionality works fine.

When I compare the html in both cases, they look almost identical - structure and classes are the same. I do not get however the ::before pseudo class on the relevant span element when I implement your code.  We are however using scss and not css in our setup. Any idea how to fix that? Toolbar icons for e.g. your grid component work fine.

Regards
Julius



RV Ravikumar Venkatesan Syncfusion Team November 18, 2020 07:58 AM UTC

Hi Julius, 

Thanks for the update. 

We have validated your reported query at our end. In our previously shared sample, we can able to see the print icon in the Schedule toolbar. We have prepared an angular sample that using the SCSS stylesheet and we have modified your shared TS sample with the print icon both which can be available below. Also, we have prepared a video demo for your reference. 



Kindly try the above samples and if you still facing the same problem please share the sample illustrating the issue to proceed further. 

Regards, 
Ravikumar Venkatesan 


Marked as answer

JP Julius Peter November 18, 2020 12:03 PM UTC

Thanks Ravikumar,
finally got it to work - needed to remove the .schedule-print class from the scss statements in my case.... as simple as that.....
Was also able to use the standard e-icon font (used already in other cases) with the #e813 icon.

Regards
Julius


NR Nevitha Ravi Syncfusion Team November 19, 2020 05:18 AM UTC

Hi Julius, 

You are most welcome, we are happy that your issue has been resolved. 

Regards, 
Nevitha 


Loader.
Up arrow icon