Use stylesheet 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 stylesheet 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 stylesheet 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 stylesheet cell
Page sequence - Blank specifies
the content for a blank page; by default, the content is empty. Similarly,
- Right Side 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.
You can use the Properties pane of a stylesheet cell to specify content that satisfies specified conditions. The Properties pane for a stylesheet cell includes the following.
|Condition||Condition 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 Template||Name 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 Condition||Possible Values for the Condition||Sample XML Code|
right center left
$position='right' $position='center' $position='left'
odd even first blank
$sequence=odd $sequence=even $sequence=first $sequence=blank
$titlepage $lot $body
$pageclass=$titlepage $pageclass=$lot $pageclass=$body
Use standard logical operators (such as
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.
Templates are available for adding the following items to headers and footers:
Titles for chapters and sections
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
To use a template to specify content for a header or footer:
In the Append template list, select the type of content you want to add.
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:
Select Text from the Append template list.
The default value for
Edit the value as needed.
To add a graphics file to headers or footers in a report, you must:
Specify the name of the file in the Header Content or Footer Content stylesheet cell.
Edit the values of the
Region Before Extent and
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.
PDF reports only support bitmap (
You cannot use stylesheet 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 stylesheets. 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.