<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ODS RTF Separate document header and table title in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-RTF-Separate-document-header-and-table-title/m-p/975637#M26921</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using proc template to generate a systemtitle with preimage and pretext. This is the header for the complete document.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc template;
define style Styles.Custom_nl;
parent = Styles.Printer;
 
style Body from Defaults/
  topmargin=0.6in
  leftmargin=0.6in
  rightmargin=0.6in 
  just = center
;
 
replace fonts /
'TitleFont' = ("Segoe UI",12pt,Bold) /* Titles from TITLE statements */
'TitleFont2' = ("Segoe UI",10pt,Bold ) /* Proc titles ("The XX Procedure")*/
'headingFont' = ("Segoe UI",10pt,Bold) /* Table column and row headings */
'docFont' = ("Segoe UI",8pt) /* Data in table cells */
'footFont' = ("Segoe UI",8pt) /* Footnotes from FOOTNOTE statements */;
 
replace color_list /
'bgH' = cx9C1B3A /* row and column header background */
'bgT' = white /* table background */
'bgD' = white /* data cell background */
'fg1' = black /* text color */
'fg2' = white 
'bg' = white; /* page background color */
 
replace Table from Output /
frame = box /* outside borders: void, box, above/below, vsides/hsides, lhs/rhs */
rules = all /* internal borders: none, all, cols, rows, groups */
cellpadding = 4pt /* the space between table cell contents and the cell border */
cellspacing = 0.25pt /* the space between table cells, allows background to show */
borderwidth = 0.25pt /* the width of the borders and rules */ 
background = color_list('bgT') ;
 
 
style header /
	background = cx9C1B3A
	foreground = white 
	font = fonts("Headingfont") 
	font_weight = bold;
 
 
Style systemtitle from TitlesAndFooters /
font = fonts("TitleFont")
cellpadding = 0
cellspacing = 0
preimage = "logo.png" 
pretext = ' My header '
;
 
Style PageNo from TitlesAndFooters /
font = fonts("footFont")
cellpadding = 0
cellspacing = 0
pretext = "Page "
just=r
vjust=b;
 
/* style SystemFooter from SystemFooter /*/
/* font = fonts("footFont");*/
 
style rowheader from header;
 
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use the title for my table it get added to the header of the document instead of forming a header in the document.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;options  papersize=A4 nodate orientation=landscape center;
ods rtf file = 'doc.rtf' style= Custom_nl;
title 'Boys';
proc print data=sashelp.class(where=(sex='M'));
run;
title 'Girls';
proc print data=sashelp.class(where=(sex='F'));
run;
ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The result is the following.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="results.png" style="width: 361px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110119i598D8AF8F03779B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="results.png" alt="results.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to have the following as the results where my title is not a part of the header of the document.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="results1.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110120iC6799D2BBF38B97E/image-size/large?v=v2&amp;amp;px=999" role="button" title="results1.png" alt="results1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is highly appreciated. Thanks a lot.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Sep 2025 09:52:20 GMT</pubDate>
    <dc:creator>snakes</dc:creator>
    <dc:date>2025-09-24T09:52:20Z</dc:date>
    <item>
      <title>ODS RTF Separate document header and table title</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-RTF-Separate-document-header-and-table-title/m-p/975637#M26921</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using proc template to generate a systemtitle with preimage and pretext. This is the header for the complete document.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc template;
define style Styles.Custom_nl;
parent = Styles.Printer;
 
style Body from Defaults/
  topmargin=0.6in
  leftmargin=0.6in
  rightmargin=0.6in 
  just = center
;
 
replace fonts /
'TitleFont' = ("Segoe UI",12pt,Bold) /* Titles from TITLE statements */
'TitleFont2' = ("Segoe UI",10pt,Bold ) /* Proc titles ("The XX Procedure")*/
'headingFont' = ("Segoe UI",10pt,Bold) /* Table column and row headings */
'docFont' = ("Segoe UI",8pt) /* Data in table cells */
'footFont' = ("Segoe UI",8pt) /* Footnotes from FOOTNOTE statements */;
 
replace color_list /
'bgH' = cx9C1B3A /* row and column header background */
'bgT' = white /* table background */
'bgD' = white /* data cell background */
'fg1' = black /* text color */
'fg2' = white 
'bg' = white; /* page background color */
 
replace Table from Output /
frame = box /* outside borders: void, box, above/below, vsides/hsides, lhs/rhs */
rules = all /* internal borders: none, all, cols, rows, groups */
cellpadding = 4pt /* the space between table cell contents and the cell border */
cellspacing = 0.25pt /* the space between table cells, allows background to show */
borderwidth = 0.25pt /* the width of the borders and rules */ 
background = color_list('bgT') ;
 
 
style header /
	background = cx9C1B3A
	foreground = white 
	font = fonts("Headingfont") 
	font_weight = bold;
 
 
Style systemtitle from TitlesAndFooters /
font = fonts("TitleFont")
cellpadding = 0
cellspacing = 0
preimage = "logo.png" 
pretext = ' My header '
;
 
Style PageNo from TitlesAndFooters /
font = fonts("footFont")
cellpadding = 0
cellspacing = 0
pretext = "Page "
just=r
vjust=b;
 
/* style SystemFooter from SystemFooter /*/
/* font = fonts("footFont");*/
 
style rowheader from header;
 
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use the title for my table it get added to the header of the document instead of forming a header in the document.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;options  papersize=A4 nodate orientation=landscape center;
ods rtf file = 'doc.rtf' style= Custom_nl;
title 'Boys';
proc print data=sashelp.class(where=(sex='M'));
run;
title 'Girls';
proc print data=sashelp.class(where=(sex='F'));
run;
ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The result is the following.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="results.png" style="width: 361px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110119i598D8AF8F03779B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="results.png" alt="results.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to have the following as the results where my title is not a part of the header of the document.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="results1.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110120iC6799D2BBF38B97E/image-size/large?v=v2&amp;amp;px=999" role="button" title="results1.png" alt="results1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is highly appreciated. Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 09:52:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-RTF-Separate-document-header-and-table-title/m-p/975637#M26921</guid>
      <dc:creator>snakes</dc:creator>
      <dc:date>2025-09-24T09:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: ODS RTF Separate document header and table title</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-RTF-Separate-document-header-and-table-title/m-p/975641#M26922</link>
      <description>&lt;P&gt;To move the header into the body of the document, add the BODYTITLE option as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods rtf file = 'doc.rtf' style= Custom_nl bodytitle;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To get a line break between the PRETEXT and the TITLE text, you can add ^n either after PRETEXT or in the TITLE statement as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods escapechar='^';
ods rtf file = 'doc.rtf' style= Custom_nl bodytitle;
title '^n Boys';&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Sep 2025 11:09:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-RTF-Separate-document-header-and-table-title/m-p/975641#M26922</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2025-09-24T11:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: ODS RTF Separate document header and table title</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-RTF-Separate-document-header-and-table-title/m-p/975643#M26923</link>
      <description>&lt;P&gt;Thanks Kathryn,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue here is not the new line but separating the header of the document from the title of the table. Is there a way that the title is not added to the header of the document? I would like the title to appear on top of the table and not in the header.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;ods escapechar='^';
options  papersize=A4 nodate center;
ods rtf file = 'doc.rtf' style= Custom_nl startpage=no;
title '^n Boys';
proc print data=sashelp.class(where=(sex='M'));
run;
title '^n Girls';
proc print data=sashelp.class(where=(sex='F'));
run;
ods rtf close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In the output below you will see that the title for the second table has been moved to the header of the second page.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="results1.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110121i2725E39290C186BD/image-size/large?v=v2&amp;amp;px=999" role="button" title="results1.png" alt="results1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 11:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-RTF-Separate-document-header-and-table-title/m-p/975643#M26923</guid>
      <dc:creator>snakes</dc:creator>
      <dc:date>2025-09-24T11:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: ODS RTF Separate document header and table title</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-RTF-Separate-document-header-and-table-title/m-p/975645#M26924</link>
      <description>&lt;P&gt;You have added the STARTPAGE=NO option which was not in your original code. As I mentioned in my first statement, you use BODYTITLE to move Titles and Footnotes to the body of the document. However, when you use BODYTITLE and also use STARTPAGE=NO, this will affect the titles.&lt;/P&gt;
&lt;P&gt;You can use ODS RTF TEXT= instead of a Title statement as shown in this example.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods escapechar='^';
options  nodate orientation=landscape center papersize=a4;
ods listing close;
ods rtf file = 'doc.rtf' style= Custom_nl startpage=no bodytitle;
title 'Boys';
proc print data=sashelp.class(where=(sex='M'));
run;
title;
ods rtf text='^S={outputwidth=100% font_weight=bold font_size=12pt just=c} Girls';
proc print data=sashelp.class(where=(sex='F'));
run;
ods rtf close;
ods listing;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 11:54:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-RTF-Separate-document-header-and-table-title/m-p/975645#M26924</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2025-09-24T11:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: ODS RTF Separate document header and table title</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-RTF-Separate-document-header-and-table-title/m-p/975648#M26925</link>
      <description>&lt;P&gt;Thanks. I did not want to use ODS Text as this will lead to changing the code, but it looks like my only option.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 12:21:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-RTF-Separate-document-header-and-table-title/m-p/975648#M26925</guid>
      <dc:creator>snakes</dc:creator>
      <dc:date>2025-09-24T12:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: ODS RTF Separate document header and table title</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-RTF-Separate-document-header-and-table-title/m-p/975717#M26926</link>
      <description>&lt;P&gt;The text generated by ODS TEXT=, would get grey box around it. That lead you can not make this text as a bookmarker.&lt;/P&gt;
&lt;P&gt;So the best solution is using PRETEXT= option of PROC REPORT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options  nodate orientation=landscape center papersize=a4;
ods rtf file = 'c:\temp\doc.rtf'  startpage=no ;
proc report data=sashelp.class(where=(sex='M')) style={pretext='Boys'};
run;
proc report data=sashelp.class(where=(sex='F')) style={pretext='Girls'};
run;
ods rtf close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1758786122926.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110140iEA5285A670559EFB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1758786122926.png" alt="Ksharp_0-1758786122926.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Sep 2025 07:42:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-RTF-Separate-document-header-and-table-title/m-p/975717#M26926</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-09-25T07:42:16Z</dc:date>
    </item>
  </channel>
</rss>

