The ‘Calendar’ stencil has some great shapes like ‘Month’ and ‘Multiple Week’ for scheduling and planning. The template and stencil are part of a solution that includes an AddOn called Time Solution (‘ts’) and this is effectively a builder to create and write to all of the day sub-shapes (not to mention the Outlook import feature).
One thing I miss, though, is an easy way to print out multiple months that clearly show the difference between one month and the next. I care less about whether a month breaks across pages and more about being able to easily identify each one.
So, in this post I’ve built a shape that takes a start date and displays the following thirty four days…
This is really just a simple alternative ‘Multiple week’ shape. Given that the focus for this shape is to easily differentiate between multiple months, I’ve included shading on odd months (even one’s being plain).
Just so you can see the difference, here’s three images, the first showing the existing ‘Month’ shape:
…a second, being the existing ‘Multiple week’ shape:
…and the third showing the 35 day layout (including month shading):
The shape’s behaviour is all driven via the ShapeSheet (no AddOns here) and the start date is defined through the Shape Data window:
The shape has two ‘color modes’, also set via Shape Data. In Default mode, the shape will pickup the active theme’s fill color (including Variants) and use this in the shaded days fill, plus varying tints for line and text color. For non-shaded days the theme’s ‘Light’ color is used, which is white in nearly all cases. In Custom mode, you’re free to apply line, fill and text formatting via the UI in the normal way.
All other formatting features can be applied to the group shape and these will be propagated down to all of the sub-shapes. If you want to revert to the inherited theme values, then you can just select the first item in the Quick Styles drop-down menu and you’ll be back to the default for the active theme:
I’m hoping that the shape’s operation is reasonably self-explanatory so if you just want to use the shape then you can download from here:
The stencil file is in 2013 (.vssx) format, but if you using Visio 2010, it should still be ok with the Visio Compatibility Pack. The theming should convert to the older 2010 approach but, as it stands, I’ve only tested on 2013.
From a shape building perspective, a couple of interesting points are:
EVALCELL() + ARG() Each day sub-shape knows what date it is and carries a User.IsShaded cell. The logic that determines whether an individual day should be shaded or not could be stored in the sub-shape itself but, if you wanted to change that logic later on, you’d have to iterate through each sub-shape to make the change. Instead the logic can be stored in a single place, in the group shape and, making use of the EVALCELL ShapeSheet function, you can pass in the date argument (using ARG) to calculate the result. So the existing logic in the group shape, to work out if a date sits within an even month, looks like this:
However, if, for example, you wanted to change the shading logic to just shade weekends instead, you could change the group shape formula to the following:
Of course if you wanted completely different logic that didn’t include evaluation of a date then you’d have to revisit the the sub-shape formulae too, but I think this keeps things as flexible as reasonably possible.
Chris Roth covered this set of functions when they appeared in Visio 2007, so head over there for more details.
Build by index All of the sub-shapes size and positions are based on an index (0-34). The reason for this is that as you’re building a shape with multiple child shapes, you can focus on a single sub-shape and then duplicate it when you’re ready to populate the group. After each duplication you just need to set one cell (Prop.DayItemIdx in the the case below) and the ShapeSheet logic can handle to positioning based on a row and column grid system: