<?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 Re: Change from landscape to portrait in ODS RTF output with BODYTITLE option in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Change-from-landscape-to-portrait-in-ODS-RTF-output-with/m-p/976787#M26930</link>
    <description>Thanks, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;! Using PRETEXT= and POSTTEXT= works for tables with PROC REPORT, but is there a similar solution for figures with e,g, PROC SGPLOT?</description>
    <pubDate>Fri, 10 Oct 2025 17:00:40 GMT</pubDate>
    <dc:creator>dmuenz</dc:creator>
    <dc:date>2025-10-10T17:00:40Z</dc:date>
    <item>
      <title>Change from landscape to portrait in ODS RTF output with BODYTITLE option</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Change-from-landscape-to-portrait-in-ODS-RTF-output-with/m-p/976729#M26927</link>
      <description>&lt;P&gt;Apologies if this is a duplicate -- there are several closely related posts on this forum, but I did not see one with exactly my issue...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using ODS RTF with the BODYTITLE option, and I want some pages to be portrait and others landscape. Oddly, I can start the output file in portrait and then change to landscape, but if I start in landscape then I cannot change to portrait.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a minimal reproducible example, creating a macro that prints a two-page RTF file. You can specify the orientation of each page using the macro parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%macro rtf(orient1, orient2);
	options orientation=&amp;amp;orient1;
	ods rtf file="Orientation - &amp;amp;orient1 to &amp;amp;orient2..rtf" bodytitle;
	
	title "Page 1 Orientation: &amp;amp;orient1";
	proc print data=sashelp.class(obs=1); run;
	
	options orientation=&amp;amp;orient2;
	ods rtf;
	
	title "Page 2 Orientation: &amp;amp;orient2";
	proc print data=sashelp.class(obs=1); run;
	
	ods rtf close;
%mend;

%rtf(Portrait, Landscape) /* success: page 1 is portrait, page 2 is landscape */&lt;BR /&gt;%rtf(Landscape, Portrait) /* failure: both pages are landscape */&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This odd behavior happens only when I use the BODYTITLE option. If I remove that option, then the page orientation always changes as expected. But I don't want my table/figure titles &amp;amp; footnotes in the document header &amp;amp; footer, so I prefer to use BODYTITLE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can also fix the problem by switching to ODS TAGSETS.RTF. That works, but I already have a large codebase creating tables &amp;amp; figures using ODS RTF, and if I switch one over to using TAGSETS.RTF then for formatting consistency I'd need to switch all of them. I'd prefer to avoid that extra work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea how to fix the above code? I tried playing around with the STARTPAGE option in the ODS RTF statements, but couldn't find anything that helped.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using SAS 9.4M6 in SAS Studio.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Oct 2025 20:20:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Change-from-landscape-to-portrait-in-ODS-RTF-output-with/m-p/976729#M26927</guid>
      <dc:creator>dmuenz</dc:creator>
      <dc:date>2025-10-09T20:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Change from landscape to portrait in ODS RTF output with BODYTITLE option</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Change-from-landscape-to-portrait-in-ODS-RTF-output-with/m-p/976752#M26928</link>
      <description>&lt;P&gt;You can use option PRETEXT= to replace BODYTITLE and also could make change from landscape to portrait:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%macro rtf(orient1, orient2);

	options orientation=&amp;amp;orient1;
	ods rtf file="c:\temp\Orientation - &amp;amp;orient1 to &amp;amp;orient2..rtf"  ;
	
	proc report data=sashelp.class(obs=1) nowd 
 style(report)={pretext="Page 1 Orientation: &amp;amp;orient1" fontsize=8 fontweight=bold };
run;
	

	options orientation=&amp;amp;orient2;
	ods rtf;

	proc report data=sashelp.class(obs=1) nowd
 style(report)={pretext="Page 2 Orientation: &amp;amp;orient2" fontsize=8 fontweight=bold}; 
run;
	
	ods rtf close;
%mend;
title;
/*%rtf(Portrait, Landscape)  success: page 1 is portrait, page 2 is landscape */
%rtf(Landscape, Portrait) /* failure: both pages are landscape */
 
&lt;/PRE&gt;
&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1760082974451.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/110528i8CEF4CADE0CAA435/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1760082974451.png" alt="Ksharp_0-1760082974451.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2025 08:36:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Change-from-landscape-to-portrait-in-ODS-RTF-output-with/m-p/976752#M26928</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-10-10T08:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Change from landscape to portrait in ODS RTF output with BODYTITLE option</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Change-from-landscape-to-portrait-in-ODS-RTF-output-with/m-p/976757#M26929</link>
      <description>&lt;P&gt;The following is another work-around:&amp;nbsp;&lt;SPAN&gt;Specify an orientation of portrait before the ODS RTF FILE= statement, and then toggle the output to landscape after the ODS RTF FILE= statement. The sample code below demonstrates this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
options orientation=portrait;
ods rtf file="c:\temp\file.rtf" bodytitle;
options orientation=landscape;
ods rtf;
title 'Landscape';
  proc print data=sashelp.class;
  run;

options orientation=portrait;
ods rtf;

title 'Portrait';
  proc print data=sashelp.shoes(obs=10);
  run;

ods rtf close;
ods listing;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Oct 2025 10:50:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Change-from-landscape-to-portrait-in-ODS-RTF-output-with/m-p/976757#M26929</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2025-10-10T10:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Change from landscape to portrait in ODS RTF output with BODYTITLE option</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Change-from-landscape-to-portrait-in-ODS-RTF-output-with/m-p/976787#M26930</link>
      <description>Thanks, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;! Using PRETEXT= and POSTTEXT= works for tables with PROC REPORT, but is there a similar solution for figures with e,g, PROC SGPLOT?</description>
      <pubDate>Fri, 10 Oct 2025 17:00:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Change-from-landscape-to-portrait-in-ODS-RTF-output-with/m-p/976787#M26930</guid>
      <dc:creator>dmuenz</dc:creator>
      <dc:date>2025-10-10T17:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Change from landscape to portrait in ODS RTF output with BODYTITLE option</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Change-from-landscape-to-portrait-in-ODS-RTF-output-with/m-p/976788#M26931</link>
      <description>Thank you, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13770"&gt;@Kathryn_SAS&lt;/a&gt;! This works and completely solves my problem with minimal extra code or refactoring. But this does seem like a bug in ODS RTF. Do you know if it's been fixed in newer versions of SAS (I'm using SAS 9.4M6) or at least previously reported?</description>
      <pubDate>Fri, 10 Oct 2025 17:16:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Change-from-landscape-to-portrait-in-ODS-RTF-output-with/m-p/976788#M26931</guid>
      <dc:creator>dmuenz</dc:creator>
      <dc:date>2025-10-10T17:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Change from landscape to portrait in ODS RTF output with BODYTITLE option</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Change-from-landscape-to-portrait-in-ODS-RTF-output-with/m-p/976790#M26932</link>
      <description>&lt;P&gt;This is an ongoing issue for the RTF destination. Other than the work-around I provided, the other alternative is to use the Tagsets.RTF destination.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing close;
options orientation=landscape;
ods tagsets.rtf file='test.rtf';

title 'Landscape';
  proc print data=sashelp.class;
  run;

options orientation=portrait;

title 'Portrait';
  proc print data=sashelp.shoes(obs=10);
  run;

ods tagsets.rtf close;
ods listing;
title;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Oct 2025 17:32:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Change-from-landscape-to-portrait-in-ODS-RTF-output-with/m-p/976790#M26932</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2025-10-10T17:32:54Z</dc:date>
    </item>
  </channel>
</rss>

