Excel worksheets each contain three areas in the header and three areas in the footer which can be populated as needed. Base Extensions can be used to add/remove content directly into these areas. As well as inserting plain text it can be used in conjunction with the codes provided by Microsoft to allow references to be included, and define formatting etc. More details on this can be found here:
It is also possible to format the headers and footers using VBA formatting. This should be done by inserting the formatting code in a <![CDATA[&L&12]]>
element. Make sure that you use the alignment corresponding to the section the data is inserted in (i.e. left alignment in left section etc.).
It is important to note that there can only be added one formatting per header/footer section (left, center, or right). This is due to an Excel bug where mutliple formattings will show the inserted data as overlapping until the header/footer section is manually activated. See below image for example:
CMD
<Cmd case="BaseExtensions:xl-header-footer-text"/>
Parameters
All Parameters are optional.
AllSheets
Accepts true
or false
(default) as value. Selecting true will insert any defined text in all worksheets within the workbook.
LeftHeader
Defines the text to be displayed in the left hand side of the header. Omitting will leave that area blank.
CenterHeader
Defines the text to be displayed in the center of the header. Omitting will leave that area blank.
RightHeader
Defines the text to be displayed in the right hand side of the header. Omitting will leave that area blank.
LeftFooter
Defines the text to be displayed in the left hand side of the footer. Omitting will leave that area blank.
CenterFooter
Defines the text to be displayed in the center of the footer. Omitting will leave that area blank.
RightFooter
Defines the text to be displayed in the right hand side of the footer. Omitting will leave that area blank.
Example:
<Cmd case="BaseExtensions:xl-header-footer-text"
AllSheets="true"
LeftFooter="&Z
&F : &A
© Omnidocs | F0.13 | 14 February 2011"
RightFooter="Page &P of &N
Printed &D Time &T"
/>
This results in a footer applied to all worksheets that looks like:
Comments
0 comments
Please sign in to leave a comment.