Main Content

Style Sheet Cells for Headers and Footers

About Style Sheet Cells and Cell Groups

Use style sheet cells to specify content of headers and footers in PDF reports.

The MATLAB® Report Generator™ software defines a page as six cells. These cells correspond to the left, right, and center of the page's header and the left, right, and center of the page's footer.

A cell group consists of one or more style sheet cells. Two cell groups are available for PDF reports: Header Content and Footer Content.

The Properties pane for each cell in a cell group lists the group's current style sheet cell definitions. These definitions appear in a two-column list of Conditional cell values. The first column displays the name of a condition. The second column displays content that appears in the report if the specified condition is met.

For example, the style sheet cell Page sequence - Blank specifies the content for a blank page; by default, the content is empty. Similarly, Position - Right specifies the content for the right side of the header on every page.

You can use many combinations of conditions and values to customize content of headers and footers. The MATLAB Report Generator software provides several predefined conditions that are frequently used. These predefined cells appear in the Properties panes for the Header Content and for Footer Content cell groups.

Headers and Footers

Add Content That Satisfies Specified Conditions

You can use the Properties pane of a style sheet cell to specify content that satisfies specified conditions. The Properties pane for a style sheet cell includes the following.

LabelDefinitionDescription
ConditionCondition that must be met for content to appear in the report

This is a selection list of frequently used and predefined conditions. Select a condition and click Edit to view or change a condition's XML code

Value (XML)Content to appear in the report if the condition is met

Modify or create XML code for header or footer content

Append TemplateName of the template that you use to add content

Templates containing XML code that you can use to add content. For more information, see Add Content to Headers and Footers Using Templates.

When the File Converter processes a page, it evaluates settings that are relevant to each of the six cells on the page and adds content accordingly. If there are no conditions in effect for a given cell, the File Converter uses the default values for the cell group.

Possible conditions and their values as coded in XML are shown in the following table.

Name of ConditionPossible Values for the ConditionSample XML Code
$position
right
center
left
$position='right'
$position='center'
$position='left'
$sequence
odd
even
first
blank
$sequence=odd
$sequence=even
$sequence=first
$sequence=blank
$double-sided	
0
1
$double-sided=0
$double-sided=1	
$pageclass
$titlepage
$lot
$body
$pageclass=$titlepage
$pageclass=$lot
$pageclass=$body

Use standard logical operators (such as = , != , and, or) and nested expressions (characters between parentheses are an expression within an expression) to specify complex conditions. You can use complex conditions to set the position of headers and footers on pages. You can also use them to specify other settings, such as where in the report the content appears.

Add Content to Headers and Footers Using Templates

Templates are available for adding the following items to headers and footers:

  • Text

  • Author names

  • Page numbers

  • Titles for chapters and sections

  • Chapter numbering

  • Draft information

  • Comments

  • Graphics

Templates used by the File Converter are Extensible Style Language Transformations (XSLT), which is a language for transforming XML documents into other XML documents. For details about XSLT, see the Web site for the World Wide Web Consortium (W3C®) at https://www.w3.org/TR/xslt.

To use a template to specify content for a header or footer:

  1. In the Append template list, select the type of content you want to add.

  2. Click Append.

    The Properties pane on the right displays default content for the type you select. Edit the XML code to change the default content.

For example, to specify text as the content:

  1. Select Text from the Append template list.

  2. Click Append.

  3. The default value for xsl:text is Confidential. Edit the value as needed.

Insert Graphics Files

To add a graphics file to headers or footers in a report, you must:

  1. Specify the name of the file in the Header Content or Footer Content style sheet cell.

  2. Edit the values of the Region Before Extent and Region After Extent data items. These are located in the Pagination and General Styles folder of the Options pane for PDF formatting.

For an example of adding a graphic file to a header, see Add Graphics to Headers in PDF Reports.

Note

PDF reports only support bitmap (.bmp), jpeg (.jpg), and Scalable Vector Graphics (.svg) images in headers and footers.

Modify Fonts and Other Properties

You cannot use style sheet cells to modify the font family or other such properties of headers and footers. To specify the style of the content in headers and footers, use the Header Content Properties and Footer Content Properties attribute sets.

Each of these attribute sets is a pagination style data item for PDF style sheets. You can edit a particular attribute in the set by selecting it in the Outline pane on the left.

For an example of modifying font size and other properties of a PDF report, see Change Font Size, Page Orientation, and Paper Type of a Generated Report.