1

I'm working on a Sharepoint website and am facing a bit of a trouble printing the calendars in a good format. Basically I have overlaid Sharepoint calendars and my superiors would like to be able to print the calendars.

My ideas were to use JavaScript in order to generate a whole new printer-friendly calendar (by using the elements stored in my original calendar), but I'd like to know if people had other ideas.

Thanks a lot!

Chris23
  • 11
  • 2
  • Question inviting suggestions rather solution, it may result in long discussions. Please add your attempts, to add some kind of support to the question. – PradyJord Jun 03 '14 at 12:49
  • Well, OOTB, Sharepoint 2013 doesn't provide any printing button so my only option was to ctrl+p on the web page and the results were definitely not acceptable. Then I thought about making my own print css, and my own print button, but it was still not producing the results I wanted ... so now, I'm currently experiencing the FullCalendar JS plugin, in order to generate this new calendar (using the Sharepoint API to retrieve the events). – Chris23 Jun 03 '14 at 13:26

1 Answers1

0

The issue is tied to the calendar items being absolutely positioned over top the calendar via a dynamic calculation. SharePoint took this approach, I suspect, because some calendar items span multiple days and there's no easy way to flow items in a cell around an item spanning cells.

We found the issue is tied to the fact that when you switch media types (from screen to print) as you do when printing or previewing, that the resize event or whatever tells SharePoint to reposition the calendar items was not firing. When I forcibly fire the resize event on media type changes, it solves the problem in Chrome but not IE.

The only solution we found, though not a great one, is to set the Calendar web part to a fixed width. This avoids the need to reflow and works across browsers. It does, however, make the page less responsive.

Mario
  • 6,572
  • 3
  • 42
  • 74
  • https://stackoverflow.com/questions/3339789/onbeforeprint-and-onafterprint-equivalent-for-non-ie-browsers/15662720#15662720 – Mario Aug 03 '18 at 19:30
  • 1
    Hi, I totally forgot I had posted this. So I ended up developing everything from scratch with the Sharepoint API and it worked brilliantly. I have a dedicated Sharepoint page with the calendar, that I fill with events inside my Sharepoint calendars. So my users only have to insert the events and they will appear in the calendar :) – Chris23 Aug 04 '18 at 20:08
  • Yes. Reasonable. Often SharePoint itself gets in the way of developing. I have a saying when I develop with SharePoint that I try to take the SharePoint out of SharePoint. That is, that I try to make SharePoint an incidental concern to what needs accomplished. – Mario Aug 06 '18 at 11:59