BookmarkSubscribeRSS Feed
Daniel
Obsidian | Level 7
Good afternoon,

I have a problem with the following code, which gives me what I want in the PDF destination, but not in the RTF destination. When I specify that the top border of the header should be red, I get a red top border in the PDF file, but not in the RTF file.

If I remove the COMPUTE BEFORE _PAGE_ section, the red border appears in RTF. I tried placing the border color instructions in the COMPUTE statement, but to no avail.

What could explain this? Here is the sample code to test:

ODS RTF STYLE=JOURNAL FILE="TEST_RTF.RTF";
ODS PDF STYLE=JOURNAL FILE="TEST_PDF.PDF";
PROC REPORT DATA=SASHELP.DEMOGRAPHICS NOWD STYLE(REPORT)=[FRAME=HSIDES WIDTH=100%]
STYLE(HEADER)=[BORDERTOPCOLOR=RED];
COLUMNS REGION NAME POP;
DEFINE REGION / GROUP "This is the region column";
DEFINE NAME / DISPLAY "This is the name column";
DEFINE POP / DISPLAY "This is the population column";
COMPUTE BEFORE _PAGE_;
LINE @1 "This is HEADER line 1";
LINE @1 "This is HEADER line 2";
ENDCOMP;
COMPUTE AFTER _PAGE_;
LINE @1 "This is FOOTER line 1";
LINE @1 "This is FOOTER line 2";
ENDCOMP;
RUN;
ODS RTF CLOSE;
ODS PDF CLOSE;

Thank you in advance for your help/suggestions,

Daniel
1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi:
I can't remember off the top of my head whether the border(top) width is different for RTF vs PDF, or whether there are destination defaults that could be impacting what you see but you could try setting bordertopwidth explicitly:
[pre]
PROC REPORT DATA=SASHELP.shoes NOWD
STYLE(REPORT)=[FRAME=HSIDES WIDTH=100%]
STYLE(HEADER)=[BORDERTOPCOLOR=RED bordertopwidth=5];
[/pre]

cynthia

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1518 views
  • 0 likes
  • 2 in conversation