• CPAO: Entire Notes for Monthly Template in PDF format

    After making all these posts on editing CPAO - I can see that it will be nice to have them all together in one paper that can be used for reference. I have uploaded a PDF that has all the CPAO template editing posts in them. Hopefully this will be a help for anyone who needs to edit these templates to fulfill a printing need for Outlook calendars.

     

  • CPAO: Listing of the Standard Month Legal Template

     

    Here is the entire listing of the code from the Standard Month Legal template I created.

    First - here is the contents of the Metadata.xml file:

     

    <Metadata xmlns="http://schemas.microsoft.com/2005/xcal" Version="1.0.0">

    <Name>Standard Month Legal</Name>

    <TimeUnit>Month</TimeUnit>

    <PageSizeSelectionIndex>Legal</PageSizeSelectionIndex>

    <PageHeight>14in</PageHeight>

    <PageWidth>8.5in</PageWidth>

    <PageOrientationSelectionIndex>Portrait</PageOrientationSelectionIndex>

    <PageRow>1</PageRow>

    <PageColumn>1</PageColumn>

    <Thumbnail>DefaultPreview.gif</Thumbnail>

    <Tasks>true</Tasks>

    <Appointments>true</Appointments>

    <SideBySide>false</SideBySide>

    <PageCount>1</PageCount>                

    <TemplateId>135</TemplateId>

    <CompanyId>1</CompanyId>

    </Metadata>

     

    And then here is the listing of the entire Content.xml file:

     

    <?xml version="1.0" encoding="utf-8"?>

    <!-- Copyright (c) 2007, Microsoft Corporation. All rights reserved. -->

    <!-- Standard Month Legal -->

    <Template xmlns="http://schemas.microsoft.com/2005/xcal" Version="1.0.0">

      <Display>

        <Page RowSetting="0.25in,Auto,0.08in,*,0.4in"

              ColumnSetting="0.25in,*,0.25in" Style="StandardText">

          <!-- Background -->

          <Rectangle Row="0" Column="0" RowSpan="5" ColumnSpan="3"

                     Style="PageBackground"/>

          <!--Week Header-->

          <Grid Row="1" Column="1" RowSetting="Auto"

                ColumnSetting="*,1.3in,1.3in,1.3in" Style="Header"

                Padding=".08in" Background="Black">

            <!--Month Title-->

            <CalendarText Row="0" Column="0"

                          Text="#[@TemplateDate_MonthNameYearNumber]"

                          HorizontalAlignment="Left" FontSize="30pt"

                          FontWeight="Bold" Foreground="Yellow"/>

            <!--Banners-->

            <MonthWeekDayCalendar Row="0" Column="1" Height="1.1in"

                                  Width="1.25in" VerticalAlignment="Center"

                                  HorizontalAlignment="Center"

                                  Style="BannerControl">

              <MonthFormat DateOffset="-1">

                <DockPanel>

                  <CalendarText Orientation="Top"

                                Text="#[@TemplateDate_BannerMonthNameYear]"

                                Height="0.19in" FontSize="8pt"

                                Style="BannerTitle"/>

                  <WeekHeader Orientation="Top" Height="0.15in" FontSize="7pt"

                              Format="d" Style="BannerWeekHeader"/>

                  <StandardGrid Orientation="Fill" NumColumns="1" NumRows="6"

                                Style="BannerBody" />

                </DockPanel>

              </MonthFormat>

              <WeekFormat>

                <DockPanel>

                  <CalendarText Orientation="Left" Width="0.15in"

                                Text="#[@TemplateDate_WeekNumber]"

                                FontSize="5pt" Style="BannerText"

                                HorizontalAlignment="Left" Margin="1,0,0,0">

                    <ConditionalFormat Condition="ShowWeekNumber eq 'false'"

                                       Visibility="Collapsed"/>

                  </CalendarText>

                  <StandardGrid Orientation="Fill" NumRows="1" NumColumns="7" />

                </DockPanel>

              </WeekFormat>

              <DayFormat>

                <Banner Text="#[%d]" FontSize="7pt" Style="BannerText">

                  <ConditionalFormat Condition="OutsideMonthDays eq 'true'"

                                     Visibility="Collapsed"/>

                  <ConditionalFormat Condition="DayOfWeek eq 'sun'"

                                     Foreground="style!WeekendColor"

                                     ForegroundHighlight="style!WeekendColor"/>

                  <ConditionalFormat Condition="DayOfWeek eq 'sat'"

                                     Foreground="style!WeekendColor"

                                     ForegroundHighlight="style!WeekendColor"/>

                </Banner>

              </DayFormat>

            </MonthWeekDayCalendar>

            <MonthWeekDayCalendar Row="0" Column="2" Height="1.1in"

                                  Width="1.25in" VerticalAlignment="Center"

                                  HorizontalAlignment="Center"

                                  Style="BannerControl">

              <MonthFormat DateOffset="1">

                <DockPanel>

                  <CalendarText Orientation="Top"

                                Text="#[@TemplateDate_BannerMonthNameYear]"

                                Height="0.19in" FontSize="8pt"

                                Style="BannerTitle"/>

                  <WeekHeader Orientation="Top" Height="0.15in" FontSize="7pt"

                              Format="d" Style="BannerWeekHeader"/>

                  <StandardGrid Orientation="Fill" NumColumns="1" NumRows="6"

                                Style="BannerBody" />

                </DockPanel>

              </MonthFormat>

              <WeekFormat>

                <DockPanel>

                  <CalendarText Orientation="Left" Width="0.15in"

                                Text="#[@TemplateDate_WeekNumber]"

                                FontSize="5pt" Style="BannerText"

                                HorizontalAlignment="Left" Margin="1,0,0,0">

                    <ConditionalFormat Condition="ShowWeekNumber eq 'false'"

                                       Visibility="Collapsed"/>

                  </CalendarText>

                  <StandardGrid Orientation="Fill" NumRows="1" NumColumns="7" />

                </DockPanel>

              </WeekFormat>

              <DayFormat>

                <Banner Text="#[%d]" FontSize="7pt" Style="BannerText">

                  <ConditionalFormat Condition="OutsideMonthDays eq 'true'"

                                     Visibility="Collapsed"/>

                  <ConditionalFormat Condition="DayOfWeek eq 'sun'"

                                     Foreground="style!WeekendColor"

                                     ForegroundHighlight="style!WeekendColor"/>

                  <ConditionalFormat Condition="DayOfWeek eq 'sat'"

                                     Foreground="style!WeekendColor"

                                     ForegroundHighlight="style!WeekendColor"/>

                </Banner>

              </DayFormat>

            </MonthWeekDayCalendar>

            <MonthWeekDayCalendar Row="0" Column="3" Height="1.1in"

                                  Width="1.25in" VerticalAlignment="Center"

                                  HorizontalAlignment="Center"

                                  Style="BannerControl">

              <MonthFormat DateOffset="2">

                <DockPanel>

                  <CalendarText Orientation="Top"

                                Text="#[@TemplateDate_BannerMonthNameYear]"

                                Height="0.19in" FontSize="8pt"

                                Style="BannerTitle"/>

                  <WeekHeader Orientation="Top" Height="0.15in" FontSize="7pt"

                              Format="d" Style="BannerWeekHeader"/>

                  <StandardGrid Orientation="Fill" NumColumns="1" NumRows="6"

                                Style="BannerBody" />

                </DockPanel>

              </MonthFormat>

              <WeekFormat>

                <DockPanel>

                  <CalendarText Orientation="Left" Width="0.15in"

                                Text="#[@TemplateDate_WeekNumber]"

                                FontSize="5pt" Style="BannerText"

                                HorizontalAlignment="Left" Margin="1,0,0,0">

                    <ConditionalFormat Condition="ShowWeekNumber eq 'false'"

                                       Visibility="Collapsed"/>

                  </CalendarText>

                  <StandardGrid Orientation="Fill" NumRows="1" NumColumns="7" />

                </DockPanel>

              </WeekFormat>

              <DayFormat>

                <Banner Text="#[%d]" FontSize="7pt" Style="BannerText">

                  <ConditionalFormat Condition="OutsideMonthDays eq 'true'"

                                     Visibility="Collapsed"/>

                  <ConditionalFormat Condition="DayOfWeek eq 'sun'"

                                     Foreground="style!WeekendColor"

                                     ForegroundHighlight="style!WeekendColor"/>

                  <ConditionalFormat Condition="DayOfWeek eq 'sat'"

                                     Foreground="style!WeekendColor"

                                     ForegroundHighlight="style!WeekendColor"/>

                </Banner>

              </DayFormat>

            </MonthWeekDayCalendar>

          </Grid>

          <!--MonthDayCalendar Sizer-->

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

            <MonthFormat>

              <DockPanel Style="LevelOneParent">

                <WeekHeader Orientation="Top" Height="0.2in" FontSize="8pt"

                            Format="ddd" Style="LevelOneTitle"/>

                <WeekGrid Orientation="Fill" NumRows="Auto" NumColumns="7"

                          Style="LevelOneBody" UnitRestriction="true">

                  <SpanningAllDayArea MinSize="0" MaxSize="95" IsUniform="false"

                                      Margin="2">

                    <AllDayAppointment Height="28" Margin="2,1,2,0"

                                       Style="SingleAppointment"

                                       Background="Yellow">

                      <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="62"

                               SeparatorFontFamily="Symbol" FontSize="8pt"

                               TextWrapping="Wrap">

                        <ContentElement Source="CategorySymbols"/>                   

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

                        <ContentElement Source="Location"/>

                        <ContentElement Source="Organizer"/>

                        <ContentElement Source="CategorySymbols"/>

                      </Content>

                    </AllDayAppointment>

                  </SpanningAllDayArea>           

                </WeekGrid>

              </DockPanel>

            </MonthFormat>

            <DayFormat>

              <Grid RowSetting="*" ColumnSetting="*" Height="Auto"

                    Style="LevelLeafParent">

                <CalendarText Row="0" Column="0" FontSize="10pt"

                              HorizontalAlignment="Right"

                              VerticalAlignment="Bottom" Text="#[%d]"

                              FontFamily="style!FontMajor">

                  <Foreground>

                    <SolidColorBrush Color="style!mainDark1" Tint=".7"/>

                  </Foreground>

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

                    <Foreground>

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

                    </Foreground>

                  </ConditionalFormat>

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

                    <Foreground>

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

                    </Foreground>

                  </ConditionalFormat>

                </CalendarText>

                <DockPanel Row="0" Column="0" Style="LevelLeafBody" >

                  <SpanningAllDayAreaPlaceholder Orientation="Top" />

                  <!-- <CompactList Padding="2" Orientation="Fill"

                           FontSize="8pt" TypeFilter="AppointmentsTasks"/> -->

             <List Orientation="Fill" FontSize="7pt" ShowEmptyRow="true"

                   MaxRowWrap="5" RowSize="14"

                   TypeFilter="AppointmentsTasks">

          <Columns>

                    <Column Width="*" ShowDuplicates="True" Left="1"

                            Top="2" Right="1" Bottom="2" >

                      <Sources>

                        <Source Name="CategorySymbols"/>

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

                                StartSeparator=""/>

                        <Source Name="EndTime" Format="t"

                                StartSeparator="-"/>

                        <Source Name="Subject" StartSeparator=": "/>

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

                                                EndSeparator=")"/>

                             <Source Name="CategorySymbols"/>

                      </Sources>

                    </Column>

               </Columns>

       </List>

     

                </DockPanel>

              </Grid>

            </DayFormat>

          </MonthDayCalendar>

          <!-- Standard Footer -->

          <Grid Row="4" Column="1" VerticalAlignment="Top" Margin="0,4,0,0"

                RowSetting="Auto" ColumnSetting="*,*,*">

            <CalendarText Row="0" Column="0" Text="Wingtip Toys"

                          HorizontalAlignment="Left" FontSize="8pt"

                          FontWeight="Bold" />

            <CalendarText Row="0" Column="1" Text="#[@TemplateDocInfo_Page]"

                          HorizontalAlignment="Center" FontSize="7pt"/>

            <CalendarText Row="0" Column="2" Date="#[Now]"

                          Text="#[@TemplateDocInfo_PrintTime]"

                          HorizontalAlignment="Right" FontSize="7pt"/>

          </Grid>

        </Page>

      </Display>

    </Template>

     

    I have also attached the Content.xml file to this post for your convenience. You can use this to do some comparisons with other templates (like the "Month_StandardMonth01.catx" template it was derived from) , and/or to do some editing of your own :-)

     

     

  • Editing Calendar Printing Assistant Templates

    I am going to be posting an ongoing series of topics dealing with editing templates for the Calendar Printing Assistant. I'll start the title of each one with "CPAO:" so they can be easy to find.

  • CPAO: Editing the Calendar Grid (Part 1)

     

     

    And now to editing what is seen in the calendar. I am still using the "Standard Month 01 Letter" template as the base for showing some options here. So here is the code that describes the layout of the appointments and the grid:

     

          <!--MonthDayCalendar Sizer-->

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

            <MonthFormat>

              <DockPanel Style="LevelOneParent">

                <WeekHeader Orientation="Top" Height="0.3in" FontSize="10pt"

                            Format="dddd" Style="LevelOneTitle"/>

                <WeekGrid Orientation="Fill" NumRows="Auto" NumColumns="7"

                          Style="LevelOneBody" UnitRestriction="false">

                  <SpanningAllDayArea MinSize="0" MaxSize="53" IsUniform="false"

                                      Margin="2">

                    <AllDayAppointment Height="16" Margin="2,1,2,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>           

                </WeekGrid>

              </DockPanel>

            </MonthFormat>

            <DayFormat>

              <Grid RowSetting="*" ColumnSetting="*" Height="Auto"

                    Style="LevelLeafParent">

                <CalendarText Row="0" Column="0" FontSize="46pt" FontWeight="Bold"

                              Text="#[%d]" FontFamily="style!FontMajor">

                  <Foreground>

                    <SolidColorBrush Color="style!mainDark1" Tint=".7"/>

                  </Foreground>

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

                    <Foreground>

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

                    </Foreground>

                  </ConditionalFormat>

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

                    <Foreground>

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

                    </Foreground>

                  </ConditionalFormat>

                </CalendarText>

                <DockPanel Row="0" Column="0" Style="LevelLeafBody" >

                  <SpanningAllDayAreaPlaceholder Orientation="Top" />

                  <CompactList Padding="2" Orientation="Fill" FontSize="8pt"

                               TypeFilter="AppointmentsTasks"/>

                </DockPanel>

              </Grid>

            </DayFormat>

          </MonthDayCalendar>

     

    This area of code can be broken into two parts - the Month Format part and the Day Format part.

     

    Here is the Month Format part:

     

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

            <MonthFormat>

              <DockPanel Style="LevelOneParent">

                <WeekHeader Orientation="Top" Height="0.3in" FontSize="10pt"

                            Format="dddd" Style="LevelOneTitle"/>

                <WeekGrid Orientation="Fill" NumRows="Auto" NumColumns="7"

                          Style="LevelOneBody" UnitRestriction="false">

                  <SpanningAllDayArea MinSize="0" MaxSize="53" IsUniform="false"

                                      Margin="2">

                    <AllDayAppointment Height="16" Margin="2,1,2,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>           

                </WeekGrid>

              </DockPanel>

            </MonthFormat>

     

    First - MonthDayCalendar is in Row 3 and Column 1. If you refer back to the Page settings section - you will see that this area was set with asterisks (*) since this area will be described using additional code.

     

    The WeekHeader part describes - well - the week header:

     

    <WeekHeader Orientation="Top" Height="0.3in" FontSize="10pt" Format="dddd"

                Style="LevelOneTitle"/>

     

    It describes the height of this area, the font size to use, and the format of the days. Using "dddd" there means to spell out the entire day name. Using "ddd"  means that abbreviations would be used like Sun Mon Tue etc. Using just "d" means using just the first letter of the day.

    Orientation of "Top" means that it is placed on top of the month grid. Designating "Bottom" here would place this WeekHeader on the bottom of the grid.

     

    The WeekGrid part tells how to make the grid.

    <WeekGrid Orientation="Fill" NumRows="Auto" NumColumns="7" Style="LevelOneBody"

              UnitRestriction="false">

     

    The orientation is "fill" which means to fill each day in the grid. NumRows of "Auto" means that it should use as many rows as is needed for the entire month. NumColumns is 7 because there are 7 days in each week. "UnitRestriction" tells whether or not to show data from other months. When set to "false" it will show data from other months in the grid. When set to "true" then data from other months will not show in the grid.

     

    UnitRestriction="false"

     

    UnitRestriction="true"

     

    Notice that the previous month's items and dates are not shown when UnitRestriction is set to "true".

     

    All the code in green above describes how All Day Events will be done.

                  <SpanningAllDayArea MinSize="0" MaxSize="53" IsUniform="false"

                                      Margin="2">

                    <AllDayAppointment Height="16" Margin="2,1,2,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>           

     

    The "SpanningAllDayArea" line describes how much space will be used for all day events. The Min is 0, Max is 53 - which allows about 3 or 4 All Day Events to show in a day. If you need more space here - just increase the MaxSize value as needed. I have found that around 160 is the most you can have/need for a standard letter-sized portrait printout.

    The "AllDayAppointment" line describes the height for each all day event. You can make this shorter - but it's best to change the font size to a smaller size as well so that the text will fit correctly. The style of SingleAppointment is self-explanatory. You can change the default blue for these to a different color using the "Background=" setting, like  Background="Yellow".

    The "Bar" and "ConditionalFormat" lines here describe how to format the all day events if they are marked as tentative, out of office, or free. There is a small bar on the left that will signify this:

     

    The "Content" and "ContentElement" lines describe what text will be seen and how it will be seen.

     

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

             Separator="116" SeparatorFontFamily="WingDings" FontSize="8pt"

             TextWrapping="NoWrap">

     

    The Separator is a diamond ( t ), which is character 116 (0x74) in the Wingdings character set. You can use the Character Map utility to find a replacement - for instance you might want a greater-than sign instead ( > ) from the Symbol character set, so that would be  Separator="62"  SeparatorFontFamily="Symbol"

    The TextWrapping setting can be set to "NoWrap" or "Wrap". "Wrap" will allow the text to wrap to the next line if needed, and if there is space for it. For instance - I made some changes in this area as sort of described above, and here is how things look:

     

     

    Here is the changed code that affects the all day events above:

     

              <DockPanel Style="LevelOneParent">

                <WeekHeader Orientation="Top" Height="0.25in" FontSize="8pt"

                            Format="ddd" Style="LevelOneTitle"/>

                <WeekGrid Orientation="Fill" NumRows="Auto" NumColumns="7"

                          Style="LevelOneBody" UnitRestriction="true">

                  <SpanningAllDayArea MinSize="0" MaxSize="100" IsUniform="false"

                                      Margin="2">

                    <AllDayAppointment Height="28" Margin="2,1,2,0"

                                       Style="SingleAppointment" Background="Yellow">

                      <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="62"

                               SeparatorFontFamily="Symbol" FontSize="8pt"

                               TextWrapping="Wrap">

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

                        <ContentElement Source="Location"/>

                        <ContentElement Source="Organizer"/>

                        <ContentElement Source="CategorySymbols"/>

                      </Content>

                    </AllDayAppointment>

                  </SpanningAllDayArea>           

                </WeekGrid>

              </DockPanel>

     

    So now the all day appointments have a bigger height (28 instead of 16) which allows wrapping to work, which shows the location for the all day events. I also went ahead and changed the separator to the greater-than symbol. And I changed the background to yellow as well.

     

    The "ContentElement" lines describe what to display in these All day event boxes - like the Subject, Location, Organizer, and CategorySymbols.

     

    We will look at the DayFormat area in the next section.

  • CPAO: Editing the Calendar Grid (Part 2)

     

    This section moves into the Day Format area:

     

            <DayFormat>

              <Grid RowSetting="*" ColumnSetting="*" Height="Auto"

                    Style="LevelLeafParent">

                <CalendarText Row="0" Column="0" FontSize="46pt" FontWeight="Bold"

                              Text="#[%d]" FontFamily="style!FontMajor">

                  <Foreground>

                    <SolidColorBrush Color="style!mainDark1" Tint=".7"/>

                  </Foreground>

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

                    <Foreground>

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

                    </Foreground>

                  </ConditionalFormat>

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

                    <Foreground>

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

                    </Foreground>

                  </ConditionalFormat>

                </CalendarText>

                <DockPanel Row="0" Column="0" Style="LevelLeafBody" >

                  <SpanningAllDayAreaPlaceholder Orientation="Top" />

                  <CompactList Padding="2" Orientation="Fill" FontSize="8pt"

                               TypeFilter="AppointmentsTasks"/>

                </DockPanel>

              </Grid>

            </DayFormat>

     

    Here we have formatting for each individual day in the grid.

     

    <Grid RowSetting="*" ColumnSetting="*" Height="Auto" Style="LevelLeafParent">

    Each day has a single row and a single column to place items in. The height is set to Auto - meaning that they will be set by the amount of room available on the page.

     

                <CalendarText Row="0" Column="0" FontSize="46pt" FontWeight="Bold"

                              Text="#[%d]" FontFamily="style!FontMajor">

                  <Foreground>

                    <SolidColorBrush Color="style!mainDark1" Tint=".7"/>

                  </Foreground>

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

                    <Foreground>

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

                    </Foreground>

                  </ConditionalFormat>

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

                    <Foreground>

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

                    </Foreground>

                  </ConditionalFormat>

                </CalendarText>

    These lines describe the day numbers - what size they are, what color they are, and where they are located. The "Text="#[%d]" means to display the day number. Additional settings can be put on the CalendarText line, like "HorizontalAlignment=" and "VerticalAlignment=" to place the number where you wish. Here is an example:

     

     

    Here is the code in this area for moving the day numbers to the lower right and making them smaller:

     

                <CalendarText Row="0" Column="0" FontSize="8pt"

                              HorizontalAlignment="Right" VerticalAlignment="Bottom"

                              Text="#[%d]" FontFamily="style!FontMajor">

                  <Foreground>

                    <SolidColorBrush Color="style!mainDark1" Tint=".7"/>

                  </Foreground>

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

                    <Foreground>

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

                    </Foreground>

                  </ConditionalFormat>

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

                    <Foreground>

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

                    </Foreground>

                  </ConditionalFormat>

                </CalendarText>

     

    It is generally best to move the number to the lower left or right, and not the top left or right, as the all day events will then be dropped down a line, and so less space is useable in each day in the grid. Like this:

     

     

    But if having the numbers on top works better - then you can do that as well.

     

    The conditional formatting here tests for weekend days, and then applies a different font color or foreground color for the weekend days. If you want all the days to show the same color you can remove the ConditionalFormat lines, and all the day numbers will be the same color.

     

     

                <DockPanel Row="0" Column="0" Style="LevelLeafBody" >

                  <SpanningAllDayAreaPlaceholder Orientation="Top" />

                  <CompactList Padding="2" Orientation="Fill" FontSize="8pt"

                               TypeFilter="AppointmentsTasks"/>

                </DockPanel>

    This section tells the program to put the All Day Events at the top (Orientation="Top") and then the CompactList line fills each day with the appointments for the corresponding day. The CompactList line is easy - you just give a font size and a filter, and it just does it. It prints a blue dot for the default calendar - and other shapes/colors for additional calendars' appointments if they are present, then the time, then the subject, then the location for each appointment.

    The "TypeFilter" setting can be set to:

    "AppointmentsTasks" - all appointments and tasks

    "Appointments" - all appointments, no tasks

    "AppointmentsTasksAllDayAppointments" - All appointments, tasks, and all day events

     

     

    Here is an example of the CompactList output:

     

    It shows the blue dot for every appointment regardless of category since this is the default Calendar open in Outlook, then the times, then the subject, then the location in parentheses.

     

     

    Now, if you do not like the formatting of the CompactList, or it does not meet your needs, you can remove that line and create a more manual list. Here is code that shows this:

     

                <DockPanel Row="0" Column="0" Style="LevelLeafBody" >

                  <SpanningAllDayAreaPlaceholder Orientation="Top" />

                  <!-- <CompactList Padding="2" Orientation="Fill" FontSize="8pt"

                                    TypeFilter="AppointmentsTasks"/> -->

        <List Orientation="Fill" FontSize="7pt" ShowEmptyRow="true"

              MaxRowWrap="5" RowSize="14"

              TypeFilter="AppointmentsTasks">

          <Columns>

                    <Column Width="*" ShowDuplicates="True" Left="1" Top="2"

                            Right="1" Bottom="2" >

                      <Sources>

                        <Source Name="CategorySymbols"/>

         <Source Name="CategorySymbols"/>

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

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

                        <Source Name="Subject" StartSeparator=": "/>

                        <Source Name="Location"

                                StartSeparator="(" EndSeparator=")"/>

                      </Sources>

                    </Column>

               </Columns>

       </List>

               </DockPanel>

     

    So instead of using the "CompactList" line here, it has been commented out and in its place is a "List" line instead along with some additional formatting lines. This gives more control over what is displayed for each appointment. In the example above, various formatting options are set - like the font size to be used, how many lines to wrap if there is a long subject and/or location line on the appointment (MaxRowWrap), the height of the row (RowSize) and what will be shown using the "TypeFilter".

    The Columns/Column/Sources and Source lines format what will be seen for each appointment. The CategorySymbols source is for showing the category color of the appointment if categories are used in Outlook. It does this using a colored dot.

    Here is an example of what the above code will display:

     

     

     

    The two red dots are there because I set this appointment to have the Red Category in Outlook, and here in the template there are two "CategorySymbols" lines. There is one dot for each line.  If you only want one dot - then only use one line. If you want one dot at the beginning and then another at the end, then put a "CategorySymbols" line after the "Location" line.

    After the category dots is the start time, and then the end time with a hyphen separator. The subject is next with a colon separator, and then the location is after that and has parentheses separating it.

    You can use this more manual method of displaying the appointments so that you can format things the way you would like them to be seen.

     

    There is more that can be done in the Calendar Grid area - and this is only covering a particular Monthly print layout. There are additional options to look at in the Week and Day Templates for other various formatting options. I will not cover all of that now - but I will post things later ot cover Day and Week templates to show some things that can be done with those templates. Those other templates are pretty similar - but there are some differences that can be seen by doing comparison.

     

    Something I have learned is that you can look at other templates to see if something you want to do is already done in another template. Then just extract that template and look at the Content.xml file to see how it differs from the one you are working on, and a lot of times you can just sort of figure things out - particularly after working with the templates for a little while.