BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I'm trying to create a style sheet for use with PROC REPORT to produce RTF using SAS 9.1.3.

I want my final table to have lines at the top and the bottom of the table but no lines between rows, so am using:

STYLE TABLE FROM CONTAINER /
FRAME = HSIDES
RULES = NONE;

However I do want lines between rows in the header part of the table.
Can someone please help?
5 REPLIES 5
Kathryn_SAS
SAS Employee
Try the following sample code:

proc template;
define style styles.test;
parent=styles.rtf;
style table from output /
frame=hsides
rules=groups;
style header from headersandfooters /
background=_undef_;
end;
run;

ods listing close;
ods rtf file='test.rtf' style=styles.test;

proc report data=sashelp.class nowd;
run;

ods listing;
ods rtf close;
deleted_user
Not applicable
That doesn't work.

If you change your code to:

proc report data=sashelp.class nowd;
columns ("Line one" name) sex age weight height;
run;

you should be able see what I mean.
Kathryn_SAS
SAS Employee
Try the following:

proc template;
define style styles.test;
parent=styles.rtf;
style table from output /
frame=hsides
rules=groups;
style header from headersandfooters /
background=_undef_
protectspecialchars=off;
end;
run;

ods listing close;
ods rtf file='test.rtf' style=styles.test;

proc report data=sashelp.class nowd;
columns ("\brdrb\brdrs\brdrw15 Line one" name) sex age weight height;
run;

ods listing;
ods rtf close;
deleted_user
Not applicable
Hi Kathryn,
That does work, but only after a fashion.
There are "gaps" between the columns. They aren't necessarily visible on screen unless you zoom in to 150%+, but are clearly visible on printed output.

Is there any way of doing this without RTF commands?
Duong
Obsidian | Level 7
Hi

\brdrb\brdrs\brdrw15 is like drawing a line in a cell. Note the cells will have a padded gap
otherwise you may run into a situation where text from one cell look as if it is continous
to the next. What you want is to draw the borders - but SAS is not able to do this at the
moment.

You can draw borders by post-processing.

Duong

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register 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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 909 views
  • 0 likes
  • 3 in conversation