This article explains what the header and footer setting is and how it can be used with the binding syntax in smart templates.
Prerequisites
|
What is the header and footer setting?
The header and footer allow to input specific text, numbers, or dates in the header or footer of an Excel spreadsheet. The header and footer setting can be set statically or dynamically by using the binding syntax.
ImportantImages are not supported in the header and footer setting. This includes using a binding to an image in a data source. |
How to set the header and footer in a spreadsheet
When configuring template settings and properties, the Header Footer setting can be used to set the header and footer for the smart spreadsheet by following these steps:
- In Template Designer, open the Advanced tab.
- Click + Add property.
- In the Type field select Header Footer.
- In the Header Footer Type field select one of these options:
- allHeader: apply to all headers of the spreadsheet.
- firstHeader: apply only to the first header of the spreadsheet.
- evenHeader: apply to all even headers of the spreadsheet.
- oddHeader: apply to all odd headers of the spreadsheet.
- allFooter: apply to all footers of the spreadsheet.
- firstFooter: apply only to the first footer of the spreadsheet.
- evenFooter: apply to all even footers of the spreadsheet.
- oddFooter: apply to all odd footers of the spreadsheet.
- Enter the required binding in the desired field(s):
- Left Section Value: apply the value to the left section of the header/footer.
- Center Section Value: apply the value to the center section of the header/footer.
- Right Section Value: apply the value to the right section of the header/footer.
- Optionally, set an additional option to the fields:
- Disable Left Section Updates: Disallow the left section value from being updated after its generation when edited by the user through the document content updater.
- Disable Center Section Updates: Disallow the center section value from being updated after its generation.
- Disable Right Section Updates: Disallow the right section value from being updated after its generation.
- Click Add to document:
Note
- Multiple Header Footer settings can be created.
- The formatting (e.g. bold text) of the Header Footer can be achieved by adding the relevant formatting codes to the binding in the Left/Center/Right Section Value fields.
Header and footer examples
Example 1
Using the Header Footer setting to set the left section of the header based on the 'Name' field originating from the User Profile.
Binding | {{UserProfile.Name}} | |
---|---|---|
Input | UserProfile.Name = "Jane Doe" | UserProfile.Name = "John Doe" |
Output |
"Jane Doe" |
"John Doe" |
Example 2
Using the Header Footer setting to insert the disclaimer text in the right section of the footer based on the 'Classification' dropdown question originating from the response form.
Binding | {{Form.Classification.Name}} | |
---|---|---|
Input | Form.Classification.Name = "Internal" | Form.Classification.Name = "External" |
Output | "This is an internal disclaimer" |
"This is an external disclaimer" |
Example 3
You can use formatting codes to apply formatting to the text in the header or footer.
For example:
- &B: Turns bold text on or off.
- &E: Turns double-underline text on or off.
- &I: Turns italic text on or off.
- &S: Turns strikethrough text on or off.
- &U: Turns underline text on or off.
- &X: Turns superscript text on or off.
-
&Y: Turns subscript text on or off.
- &"fontname": Shows the text that follows in the specified font. Include the double quotation marks.
- &K<color>: Shows the text that follows in the specified color. Use a hexadecimal color value.
- &<nn>: Shows the text that follows in the specified font size. Use a two-digit number to specify the size in points.
Using the Header Footer setting to set the left section of the header based on the 'Name' and 'Title' fields originating from the User Profile and formatting the name to show in bold text using &B
:
Binding | &B{{UserProfile.Name}}&B - {{UserProfile.Title}} | |
---|---|---|
Input |
UserProfile.Name = "Jane Doe" UserProfile.Title = "Sales Manager" |
UserProfile.Name = "John Doe" UserProfile.Title = "Product Manager" |
Output |
"Jane Doe - Sales Manager" |
"John Doe - Product Manager" |
Note
|
Example 4
In example 3 only &B
is used, but you can also use multiple codes at the same time (see examples of codes listed in example 3).
In Template Designer on the Form tab, click + Add question and create two Text form fields named 'Title' and 'Project ID'. Then click Add to form.
In the Header Footer setting in the Right Section Value field use this binding:
&24&U&"Segoe UI"&K8B5DDB{{Form.Title}}&U&"Arial"&K000000
&08&B&"Arial Narrow"Project ID:&B&"Arial" {{Form.ProjectID}}
&08&B&"Arial Narrow"Author:&B&"Arial" {{UserProfile.DisplayName}}
Explanation:
Line 1: &24
sets the font size to '24', &U
makes the text underlined, &"Segoe UI"
sets the 'Segoe UI' font to be used and &K8B5DDB
sets the font color to purple. Then the value of {{Form.Title}}
is shown. The second &U
turns underline off, &"Arial"
changes the font to 'Arial' and &K000000
sets the font color to black.
Line 2: &08
sets the font size to '8', &B
makes the text bold, &"Arial Narrow"
sets the font to 'Arial Narrow'. Then the plain text 'Project ID:' is shown. The second &B
turns bold off, &"Arial"
changes the font to 'Arial' and then the value of {{Form.ProjectID}}
is shown.
Line 3: &08
sets the font size to '8', &B
makes the text bold, &"Arial Narrow"
sets the font to 'Arial Narrow'. Then the plain text 'Author:' is shown. The second &B
turns bold off, &"Arial"
changes the font to 'Arial' and then the value of {{UserProfile.DisplayName}}
is shown.
The result looks like this:
NoteNote that between each code no space is used. A space can be inserted but it will be shown in the output. For example, if a space is inserted after the first |
When a user creates a spreadsheet (with the title 'hello world') then the result looks like this:
Comments
Article is closed for comments.