SAS® 9.2 introduced new style elements BORDER<location>COLOR and BORDER<location>WIDTH, where location=BOTTOM, TOP, RIGHT, or LEFT. These style elements enable you to customize the borders inside the tables.
The sample code on the Full Code tab demonstrates how to customize the borders in the table section of ODS PDF and ODS RTF output using PROC REPORT. The first PROC REPORT step customizes column (horizontal) borders. The second PROC REPORT step customizes row (vertical) borders.
Keep in mind that any style attributes that you specify in the PROC REPORT statement are inherited if you do not override them in another PROC REPORT statement. This means that unless a particular border is specified in the COLUMN or DEFINE statement, its attributes come from the PROC REPORT statement or the underlying style.
A sample for header borders can be found in SAS Sample 46021, "Customize header borders in ODS PDF and ODS RTF output with PROC REPORT."
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.
ods escapechar="^";
options missing='' nodate;
ods pdf file='test.pdf' notoc;
ods rtf file='test.rtf';
title "Column Borders";
proc report data=sashelp.shoes nowd out=x;
column region product sales inventory returns;
define region / group style(column)=[borderrightcolor=white borderrightwidth=0]; *Works best in RTF;
define product / group style(column)=[borderleftcolor=white borderleftwidth=0]; *Works best in RTF;
define inventory / style(column)=[borderrightcolor=red];
define returns / style(column)=[borderleftcolor=red];
compute sales;
if sales.sum > 750000 then
call define(_col_,'style','style=[borderrightcolor=orange borderrightwidth=3
borderleftcolor=orange borderleftwidth=3]');
endcomp;
run;
title "Row Borders";
proc report data=sashelp.shoes nowd out=x;
column region product sales inventory returns ;
define region / group ;
define product / group ;
compute before region;
count+1;
endcomp;
compute region;
if region ^= '' and count ^=1 then call define(_row_,'style','style=[bordertopcolor=cyan bordertopwidth=3]');
endcomp;
compute sales;
if sales.sum > 750000 then
call define(_col_,'style','style=[bordertopcolor=orange bordertopwidth=3
borderbottomcolor=orange borderbottomwidth=3]');
endcomp;
run;
ods _all_ close;
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.
Type: | Sample |
Date Modified: | 2012-03-29 14:28:22 |
Date Created: | 2012-03-14 16:11:34 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
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 | |||
Windows Vista for x64 | 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 |