CPAO: Editing A Weekly Template

CPAO: Editing A Weekly Template

  • Comments 8
  • Likes

 

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.

 

 

Attachment: Content.xml
Comments
  • Outlook 2003 had the days running DOWN, then over

    M- TH

    T - F

    W - S, S

    versus OVER, then down as shown in the tempate above.

    How can I change this?

  • Sorry for the delay...

    Yes - you can do this by setting GridFlowDirection on the StandardGrid line:

    ...

    ...

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

           <WeekFormat>

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

    ...

    ...

  • This works great as does the new Weekly List 03 however I have one small issue to fix. The templates will only allow 3 all-day events on one day in the print preview. Dumping any further appointments to a second page. Is there a way to modify this template to show ALL all-day appointments for each day?

  • Hi Randy,

    When I add the following in to the weekly list:

      ...

    ...

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

          <WeekFormat>

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

    The AllDayAppointments disapear.  Any ideas what I am doing to it?

    Thanks,  Joe

  • Im trying to modify the Week with 2 day columns to not show the timestamp for the allday 12:00 to 12:00 as well as only show weekday.  Does anyone have a template like that?

  • Can anyone help me get rid of Sat and Sun on the Week List Details calendar?  I was able to remove the timestamp by simply removing the Start and End Time, and I can get rid of Sun but not Sat.  Any help is appreciated amyguysignore@gmail.com.

  • I'm trying to add a "legend" box in the header to identify the significance of each color.  Any help is appreciated.  amymgordon22@aol.com

  • Attached Content.xml file is not available.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment