Sample 35544: How to use the RTF tagset to repeat GROUP or ORDER variable values that span multiple pages
The RTF destination does not measure vertically. It sends table instructions to Microsoft Word but leaves much of the pagination up to the word processor. This means that when PROC REPORT uses a GROUP or ORDER variable and the values span more than one page, the value is not repeated at the top of the second and subsequent pages. See SAS Note 7887 for a workaround using the ODS RTF destination.
The new RTF tagset available in SAS 9.2, in conjunction with the new SPANROWS option on the PROC REPORT statement, provides a way to repeat the value of a GROUP or ORDER variable if that variable's value spans more than one page.
The SPANROWS option is described here.
The UNIFORM option for the RTF tagset is described here.
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.
The SPANROWS option on the PROC REPORT statement, along with the UNIFORM option on the ODS RTF.TAGSETS statement, results in an RTF file that repeats the values of REGION when any value spans multiple pages.
/* Close the Output window. */
ods listing close;
/* Display the RTF output in landscape orientation, */
/* and remove the date and page number. */
options orientation=landscape nodate nonumber;
/* Open the RTF tagset destination. */
ods tagsets.rtf file="tagsets.rtf" UNIFORM;
proc report nowd data=sashelp.shoes SPANROWS;
title;
col region product sales;
define region / order;
run;
ods tagsets.rtf close;
/* Turn the Output window back on and restore the options previously turned off. */
ods listing;
options orientation=portrait date number;
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.
The RTF destination does not repeat the value of a GROUP or ORDER variable if the value spans multiple pages. The RTF tagset provides the ability to do this.
Date Modified: | 2009-04-27 14:47:50 |
Date Created: | 2009-04-13 17:50:58 |
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.2 TS1M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | |
Microsoft® Windows® for x64 | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | |
Microsoft Windows XP Professional | 9.2 TS1M0 | |
Windows Vista | 9.2 TS1M0 | |
64-bit Enabled AIX | 9.2 TS1M0 | |
64-bit Enabled HP-UX | 9.2 TS1M0 | |
64-bit Enabled Solaris | 9.2 TS1M0 | |
HP-UX IPF | 9.2 TS1M0 | |
Linux | 9.2 TS1M0 | |
Linux for x64 | 9.2 TS1M0 | |
OpenVMS on HP Integrity | 9.2 TS1M0 | |
Solaris for x64 | 9.2 TS1M0 | |