CPAO: Editing A Weekly Template

 

I wanted to put a Weekly CPAO template example up - so here it is. I will start out with the Weekly List 01 Letter Template, and do some modifications to it. I will not cover the entire template - just changes that I make in it to show how it can be modified. For changes to an entire template - you should look at the Monthly Template series posted here previously. That series covers an entire template and what settings in the Content.xml and Metadata.xml are used for each section in that template. Most of what is covered there pertains to any template - Daily, Weekly, Monthly, or Yearly.

 

Okay - so here is how the Weekly List 01 template looks in its original form:

 

 

Some things to notice on this template are:

  1. They show which mailbox the appointment belongs to using the blue dot.
  2. The category is shown after the appointments along with the category name.
  3. There are lines breaking up each day - but not into any kind of time scale.
  1. There is an All Day Event on Friday - but it is listed just like every other appointment with the times set 12am to 12am.

 

So on to the modifications.

  1. I want to remove the blue dots, and the extra column that the blue dots are in. They are okay if you are opening more than one user's calendar in Outlook - but even then, you will just see a blue dot for one calendar, and then a red diamond or some other colored symbols for additional calendars. There is not way to print a legend of which calendar is which, so I like to just remove the blue dots.
  2. I want to put the category dot (the color of the category is the color of the dot) both in front and behind the appointment so that the category is more easily seen. I also don't want the category name - that seems extraneous - and takes up room on the page.
  3. I want to remove the lines breaking up each day - as they don't seem to have any functional use.
  4. I also want to differentiate the All Day Events so they can be more easily seen.

 

 

Here is the change for modification 1:

 

Original template (Content.xml):

 

...

...

      <!--WeekDayCalendar List for Original Week List Template -->

      <WeekDayCalendar Row="3" Column="1">

        <WeekFormat>

          <StandardGrid WeekendMerge="true" NumRows="3" NumColumns="2"/>

        </WeekFormat>

        <DayFormat>

          <DockPanel Margin="2" Style="LevelOneParent">

            <CalendarText Orientation="Top" Height=".2in" FontSize="9pt"

                          Text="#[@TemplateDate_DayNameDayNumber]"

                          Style="LevelOneTitle"/>

            <List Orientation="Fill" FontSize="8pt" MinimumListWidth="60"

                  ShowEmptyRow="true" MaxRowWrap="3" RowSize="16"

                  TypeFilter="AppointmentsTasksAllDayAppointments"

                  MinorLineCount="3" Style="SingleBodyBorder">

              <Columns>

                <Column Width=".2in" Left="2" Top="3" Right="2" Bottom="2"

                        Style="AccentFill">

                  <Sources>

                    <Source Name="CalendarIcon"/>

                  </Sources>

                </Column>

                <Column Width=".3in" RightBorderStrokeThickness="1"

                        RightBorderStroke="style!SingleLineStroke" Left="2"

                        Top="3" Right="2" Bottom="2" Style="AccentFill">

                  <Sources>

                    <Source Name="Complete"/>

                  </Sources>

                </Column>

...

...

 

 

 

 

Okay - so the code in RED here defined two columns. The first column is for the Calendar that the appointments belong to - it is specified by "Calendar Icon". The second column is for Tasks, and will show  tasks in progress. It also has the right border line. I added a Task so you can see this better:

 

 

As long as the task is not completed - it will show in the template like this.

So to get rid of these two columns - we only need to remove the code from the template:

 

      <!--WeekDayCalendar List for Original Week List Template -->

      <WeekDayCalendar Row="3" Column="1">

        <WeekFormat>

          <StandardGrid WeekendMerge="true" NumRows="3" NumColumns="2"/>

        </WeekFormat>

        <DayFormat>

          <DockPanel Margin="2" Style="LevelOneParent">

            <CalendarText Orientation="Top" Height=".2in" FontSize="9pt"

                          Text="#[@TemplateDate_DayNameDayNumber]"

                          Style="LevelOneTitle"/>

            <List Orientation="Fill" FontSize="8pt" MinimumListWidth="60"

                  ShowEmptyRow="true" MaxRowWrap="3" RowSize="16"

                  TypeFilter="AppointmentsTasksAllDayAppointments"

                  MinorLineCount="3" Style="SingleBodyBorder">

              <Columns>

           <!-- First Two Column Entries Were Removed -->

                <Column Width="Auto" ShowDuplicates="True" Left="2" Top="2"

                        Right="2" Bottom="2" >

                  <Sources>

                    <Source Name="StartTime" Format="t"/>

                    <Source Name="EndTime" Format="t" StartSeparator=" - "/>

                  </Sources>

                </Column>

                <Column Width="*" Left="4" Top="2" Right="2" Bottom="2">

                  <Sources>

                    <Source Name="Subject"/>

                    <Source Name="Due" StartSeparator=" (" EndSeparator=")"

                            Format="d"/>

                    <Source Name="Location" StartSeparator=" ("

                                            EndSeparator=")"/>

                    <Source Name="CategorySymbols" StartSeparator=" "/>

                    <Source Name="Categories" StartSeparator=" "/>

                  </Sources>

                </Column>

              </Columns>

...

...

 

And now the template looks a little different - the Calendar and Task signifiers are gone:

 

 

 

Alright! Now for mod 2. You can see in the shot above that the category is signified with a colored dot for that category. It is followed by the Category name. I want to change this so the name is gone, and the colored dot is before and after the appointment. Here is that change:

 

Original:

 

...

...

           <!-- First Two Column Entries Were Removed -->

                <Column Width="Auto" ShowDuplicates="True" Left="2" Top="2"

                        Right="2" Bottom="2" >

                  <Sources>

                    <Source Name="StartTime" Format="t"/>

                    <Source Name="EndTime" Format="t" StartSeparator=" - "/>

                  </Sources>

                </Column>

                <Column Width="*" Left="4" Top="2" Right="2" Bottom="2">

                  <Sources>

                    <Source Name="Subject"/>

                    <Source Name="Due" StartSeparator=" (" EndSeparator=")"

                            Format="d"/>

                    <Source Name="Location" StartSeparator=" ("

                                            EndSeparator=")"/>

                    <Source Name="CategorySymbols" StartSeparator=" "/>

                    <Source Name="Categories" StartSeparator=" "/>

                  </Sources>

                </Column>

...

...

 

The code in GREEN here describes how things will show. We just need to move some elements around here to get what we want - namely the "CategorySymbols" and the "Categories". So here is the new code:

 

...

...

 

           <!-- First Two Column Entries Were Removed -->

                <Column Width="Auto" ShowDuplicates="True" Left="2" Top="2"

                        Right="2" Bottom="2" >

                  <Sources>

                    <Source Name="StartTime" Format="t"/>

                    <Source Name="EndTime" Format="t" StartSeparator=" - "/>

                  </Sources>

                </Column>

                <Column Width="*" Left="4" Top="2" Right="2" Bottom="2">

                  <Sources>

                    <Source Name="CategorySymbols" EndSeparator=" "/>

                    <Source Name="Subject"/>

                    <Source Name="Due" StartSeparator=" (" EndSeparator=")"

                            Format="d"/>

                    <Source Name="Location" StartSeparator=" ("

                                            EndSeparator=")"/>

                    <Source Name="CategorySymbols" StartSeparator=" "/>

                    <!-- Removed "Categories" -->

                  </Sources>

                </Column>

...

...

 

And here is how this looks now:

 

 

 

Okay - modification 3 is to get rid of the lines shown inside each day. This one is pretty easy too. Here's the code:

 

Original:

 

...

...

      <!--WeekDayCalendar List for Original Week List Template -->

      <WeekDayCalendar Row="3" Column="1">

        <WeekFormat>

          <StandardGrid WeekendMerge="true" NumRows="3" NumColumns="2"/>

        </WeekFormat>

        <DayFormat>

          <DockPanel Margin="2" Style="LevelOneParent">

            <CalendarText Orientation="Top" Height=".2in" FontSize="9pt"

                          Text="#[@TemplateDate_DayNameDayNumber]"

                          Style="LevelOneTitle"/>

            <List Orientation="Fill" FontSize="8pt" MinimumListWidth="60"

                  ShowEmptyRow="true" MaxRowWrap="3" RowSize="16"

                  TypeFilter="AppointmentsTasksAllDayAppointments"

                  MinorLineCount="3" Style="SingleBodyBorder">

              <Columns>

           <!-- First Two Column Entries Were Removed -->

...

...

 

The "MinorLineCount" attribute is all we need to change here. Since there are 3 lines in each day, you would think intuitively that you would want to set it to "0" instead of "3", but that would be incorrect. Try setting it to "0" to see the effect - it will put many lines in each day. So you actually want to set it to a pretty high number so that CPAO will just not render the lines. I don't know what the threshold is - but I found that setting this to "50" seems to do the trick:

 

...

...

      <!--WeekDayCalendar List for Original Week List Template -->

      <WeekDayCalendar Row="3" Column="1">

        <WeekFormat>

          <StandardGrid WeekendMerge="true" NumRows="3" NumColumns="2"/>

        </WeekFormat>

        <DayFormat>

          <DockPanel Margin="2" Style="LevelOneParent">

            <CalendarText Orientation="Top" Height=".2in" FontSize="9pt"

                          Text="#[@TemplateDate_DayNameDayNumber]"

                          Style="LevelOneTitle"/>

            <List Orientation="Fill" FontSize="8pt" MinimumListWidth="60"

                  ShowEmptyRow="true" MaxRowWrap="3" RowSize="16"

                  TypeFilter="AppointmentsTasksAllDayAppointments"

                  MinorLineCount="50" Style="SingleBodyBorder">

              <Columns>

           <!-- First Two Column Entries Were Removed -->

...

...

 

Here's how the entire template looks now:

 

Okay - everything looks how I'm wanting now except for the All Day Events. I want those to be placed at the top of the day in a box so that it is differentiated from regular appointments. A decent amount of code must be added for this - I am merely copying it from another template that has the All Day Events set the way I am wanting.

 

Original Code:

 

...

...

      <!--WeekDayCalendar List for Original Week List Template -->

      <WeekDayCalendar Row="3" Column="1">

        <WeekFormat>

          <StandardGrid WeekendMerge="true" NumRows="3" NumColumns="2"/>

<!-- I need to put new code here, as I see in another template -->

        </WeekFormat>

        <DayFormat>

          <DockPanel Margin="2" Style="LevelOneParent">

            <CalendarText Orientation="Top" Height=".2in" FontSize="9pt"

                          Text="#[@TemplateDate_DayNameDayNumber]"

                          Style="LevelOneTitle"/>

<!-- I need to put new code here, as I see in another template -->

            <List Orientation="Fill" FontSize="8pt" MinimumListWidth="60"

                  ShowEmptyRow="true" MaxRowWrap="3" RowSize="16"

                  TypeFilter="AppointmentsTasksAllDayAppointments"

                  MinorLineCount="50" Style="SingleBodyBorder">

              <Columns>

           <!-- First Two Column Entries Were Removed -->

...

...

              <ConditionalFormat Condition="DayOfWeek eq 'sat'">

                <Background>

                  <SolidColorBrush Color="style!WeekendColor" Tint=".9"/>

                </Background>

              </ConditionalFormat>

            </List>

<!-- I need to put new code here, as I see in another template -->

          </DockPanel>

        </DayFormat>

      </WeekDayCalendar>

...

...

 

 

New Code:

 

...

...

      <!--WeekDayCalendar List for Original Week List Template -->

      <WeekDayCalendar Row="3" Column="1">

        <WeekFormat>

          <StandardGrid WeekendMerge="true" NumRows="3" NumColumns="2">

             <SpanningAllDayArea MinSize="0" MaxSize="52" IsUniform="false">

                <AllDayAppointment Height="16" Margin="3,1,3,0"

                                   Style="SingleAppointment">

                  <Bar Visibility="Collapsed" Orientation="Left" Width="5"

                       BorderThickness="0,0,1,0">

                    <ConditionalFormat Condition="BusyStatus eq 'Free'"

                                       Visibility="Visible"

                                       Style="SingleAppointmentBarFree"/>

                    <ConditionalFormat Condition="BusyStatus eq 'Tentative'"

                                       Visibility="Visible"

                                       Style="SingleAppointmentBarTentative"/>

                    <ConditionalFormat Condition="BusyStatus eq 'OutOfOffice'"

                                       Visibility="Visible"

                                       Style="SingleAppointmentBarOOF"/>

                  </Bar>

                  <Content Orientation="Fill" Margin="2,0,2,0"

                           HorizontalAlignment="Center" Separator="116"

                           SeparatorFontFamily="WingDings" FontSize="8pt"

                           TextWrapping="NoWrap">

                    <ContentElement Source="Subject" FontWeight="Bold"/>

                    <ContentElement Source="Location"/>

                    <ContentElement Source="Organizer"/>

                    <ContentElement Source="CategorySymbols"/>

                  </Content>

                </AllDayAppointment>

              </SpanningAllDayArea>

           </StandardGrid>

        </WeekFormat>

        <DayFormat>

          <DockPanel Margin="2" Style="LevelOneParent">

            <CalendarText Orientation="Top" Height=".2in" FontSize="9pt"

                          Text="#[@TemplateDate_DayNameDayNumber]"

                          Style="LevelOneTitle"/>

            <DockPanel Orientation="Fill" Style="LevelLeafBody">

              <SpanningAllDayAreaPlaceholder Orientation="Top" />

                 <List Orientation="Fill" FontSize="8pt" MinimumListWidth="60"

                       ShowEmptyRow="true" MaxRowWrap="3" RowSize="16"

                       TypeFilter="AppointmentsTasks" MinorLineCount="50"

                       Style="SingleBodyBorder" >

            <!-- First Two Column Entries Were Removed -->

...

...

                  </ConditionalFormat>

                  <ConditionalFormat Condition="DayOfWeek eq 'sat'">

                    <Background>

                      <SolidColorBrush Color="style!WeekendColor" Tint=".9"/>

                    </Background>

                  </ConditionalFormat>

                </List>

             </DockPanel>

          </DockPanel>

        </DayFormat>

      </WeekDayCalendar>

 

So this change is pretty complex. First I added the All Day Event code under the WeekFormat section.

Then I added a dock panel in the DayFormat section and specified that the AllDay appointments be placed at the top. I changed the List TypeFilter to only show Appointments and Tasks, and NOT All Day Appointments anymore. Then I closed out the dock panel section.

 

And here is how the final modified template looks:

 

 

Notice that the All Day Event for Friday is now enclosed and separated from regular appointments.

 

So this shows how you can go in and modify a Weekly CPAO template as needed for your requirements.

This particular modification set is similar to that request from a customer who wanted the output to look more like the Outlook 2003 Weekly Print view.

 

I have attached the modified Content.xml so you can use it yourself and/or compare the changes I made with the original.

 

 

Content.xml