This week, I am attempting to generate a clean, CSS driven @media -print variant of a sharepoint calendar, that people might be able to check their schedules online and have them in hand for meetings. This should be straightforward, until you realize that Sharepoint styles its calendar webpart via hard-coded tabular HTML, and styles its various events via programmatically-generated classes.
The classes are all named the same thing.
None of them are nested such that they float and clear.
Instead, they are positioned absolutely via whatever Hell-code summons them, and set to be 20px in height.
Should you change this, you will need to be changing the position of each and every event, as it is generated, even though it is not remotely telling you its complete title, even though nothing is visible, because paperless office, no-one prints things any more.
What appears to be their container table?
Not a container. That is merely a decorative suggestion, that Monday might perhaps arrive near the beginning of the week. It has nothing whatsoever to do with the actual items, except in that it may, somewhere within the bowels of the software, contribute to the initial value of the position:absolute; left:(WHY DID YOU DO THIS TO ME); tag.
Each .ms-acal-item is a block unto itself, and will need to be treated as such, for it will in no way respect the existence or positioning of any other .ms-acal-item object. Added to this is that somewhere within Sharepoint's default CSS tends to be a nasty inheritance habit, to whit: the pseudoclass, each one of which must be individually addressed in order to be repaired.
I have also spotted much use of the wily !important tag, which is a common threat upon this particular icy veldt.
This discovery has been brought to you by six hours of "this should be easy," two separate sets of developer tools, one in Chrome, one in IE, the print preview function, and the letter eff. None of this was a problem in Sharepoint 2007, whose ugly yet functional CSS mainly printed very well indeed.
Progress.
Nope, ASP.NET does allow you to do the right thing with markup and CSS if you're so inclined (although it does very little to guide you there). The monkeys in question are all in the SharePoint team.
ReplyDeleteThat... is horrible. That's horrible. I'm working on a javascript fix for it, because: when in doubt, duct tape the front end.
ReplyDelete