Sample 49731: In the ODS TAGSETS.RTF destination, display titles only on the first page, and footnotes only on the last page
Titles and footnotes are written to each page of the output in the ODS TAGSETS.RTF destination. To modify this behavior, you can use the ODS TEXT= statement to write text strings to the first and last pages of the document. When you perform this step, the TAGSETS.RTF destination output resembles the output generated by the ODS RTF destination using the BODYTITLE option.
The sample code is found on the Full Code tab.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
In the TAGSETS.RTF destination, you can use ODS TEXT= statements to write a text string to the first and last page and format the string so it looks like a title and footnote. In order to single space between text strings, use the ODS TAGSETS.RTF TEXT= statement rather than an ODS TEXT= statement. Use the TEMPLATE procedure to set the style attributes of the text strings for center justification, foreground color, and font weight and size. Note that you must use OUTPUTWIDTH=100% in order to center-justify the text. Inline formatting using an ODS escape character can be used to place the text strings in the body of the RTF document so that they appear as one set of titles and footnotes for the entire document.
Although TAGSETS.RTF is a measured destination, the ODS TEXT statements are not considered in its measurements of what fits on the page. If pagination is negatively affected by the inclusion of the text strings, you must create a pagination variable in the data set upon which a page break is forced. To do so, use the page option in the PROC REPORT BREAK AFTER statement for the dummy variable. To view the pagination logic, look on the
Full Code tab of
SAS Note 7887, "PROC REPORT does not repeat values of GROUP/ORDER variables when groups break across pages."
title;
footnote;
options noptitle nodate nonumber;
proc template;
define style styles.demo;
parent=styles.rtf;
class UserText from Note /
font_weight=bold
font_size=22pt
foreground=red
just=c
outputwidth=100%
;
end;
run;
ods escapechar='^';
ods tagsets.rtf file="tst.rtf" style=styles.demo;
ods tagsets.rtf text="My Title";
ods tagsets.rtf text="Second Title^2n";
proc report data=sashelp.class nowd;
run;
proc report data=sashelp.class nowd;
run;
ods tagsets.rtf text="^10n Footnote One";
ods tagsets.rtf text="Footnote Two";
ods _all_ close;
ods listing;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Generate an .rtf file using the TAGSETS.RTF statement and place titles on the first page and footnotes on the last page using ODS TEXT= statements. Format the text strings to mimic the look of titles and footnotes.
Date Modified: | 2013-05-21 16:20:57 |
Date Created: | 2013-04-24 12:52:36 |
Operating System and Release Information
SAS System | Base SAS | Aster Data nCluster on Linux x64 | 9.3 TS1M2 | |
DB2 Universal Database on AIX | 9.3 TS1M2 | |
DB2 Universal Database on Linux x64 | 9.3 TS1M2 | |
Greenplum on Linux x64 | 9.3 TS1M2 | |
Netezza TwinFin 32bit blade | 9.3 TS1M2 | |
Netezza TwinFin 32-bit SMP Hosts | 9.3 TS1M2 | |
Netezza TwinFin 64-bit S-Blades | 9.3 TS1M2 | |
Netezza TwinFin 64-bit SMP Hosts | 9.3 TS1M2 | |
Teradata on Linux | 9.3 TS1M2 | |
z/OS | 9.3 TS1M2 | |
Z64 | 9.3 TS1M2 | |
Microsoft® Windows® for x64 | 9.3 TS1M2 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.3 TS1M2 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.3 TS1M2 | |
Microsoft Windows Server 2003 Standard Edition | 9.3 TS1M2 | |
Microsoft Windows Server 2003 for x64 | 9.3 TS1M2 | |
Microsoft Windows Server 2008 | 9.3 TS1M2 | |
Microsoft Windows Server 2008 for x64 | 9.3 TS1M2 | |
Microsoft Windows XP Professional | 9.3 TS1M2 | |
Windows 7 Enterprise 32 bit | 9.3 TS1M2 | |
Windows 7 Enterprise x64 | 9.3 TS1M2 | |
Windows 7 Home Premium 32 bit | 9.3 TS1M2 | |
Windows 7 Home Premium x64 | 9.3 TS1M2 | |
Windows 7 Professional 32 bit | 9.3 TS1M2 | |
Windows 7 Professional x64 | 9.3 TS1M2 | |
Windows 7 Ultimate 32 bit | 9.3 TS1M2 | |
Windows 7 Ultimate x64 | 9.3 TS1M2 | |
Windows Vista | 9.3 TS1M2 | |
Windows Vista for x64 | 9.3 TS1M2 | |
64-bit Enabled AIX | 9.3 TS1M2 | |
64-bit Enabled HP-UX | 9.3 TS1M2 | |
64-bit Enabled Solaris | 9.3 TS1M2 | |
HP-UX IPF | 9.3 TS1M2 | |
Linux | 9.3 TS1M2 | |
Linux for x64 | 9.3 TS1M2 | |
Solaris for x64 | 9.3 TS1M2 | |