When generating SAS© reports in PDF format, it is common to want to refine the header's formatting. A frequent aesthetic request is to insert a horizontal line separating the title area from the report body.
However, there is often confusion between underlining text and creating a container border. If you have ever tried using the underline option in the TITLE statement, you have probably noticed that it only underlines the text (the characters). If your title is short, the line stops abruptly.
The question is therefore: how to get a separator line that extends across the entire width of the page, regardless of orientation (Portrait or Landscape) and text length?
The common mistake: the wrong style element
To change the overall appearance of reports, using PROC TEMPLATE is the recommended method. However, choosing the right style element to modify is crucial.
Many users try to modify the SysTitleandFooterContainer element by applying border rules to it (frame=below, rules=rows). Although this seems logical, this approach often fails to produce the expected visible borders in the PDF destination.
The solution: Target TitlesAndFooters
To get a border that acts as a separator line under the entire title area, you need to modify the TitlesAndFooters style element.
Here's how to do it by creating a custom style that inherits from an existing one (like styles.statistical or styles.pearl):
