BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASuserlot
Barite | Level 11

I am generating the tables using the proc report. I want to get a underline under the one of the 'Treatment' heading, I used this code  " '"^R/RTF'\brdrb\brdrs' "  in the column section however,  it not generating the underline covering the treatments. I need an underline beneath the 'Treatment'  covering all the treatments. Can you please suggest what I am doing wrong and other options to achieve it. Thanks.

 

This is the code I used in column section

 

column ("^R/RTF'\brdrb\brdrs '" sort col1 ("^R/RTF'\brdrb\brdrs' Treatment Group" trt1 trt2 trt3 trt4 ) );

 

This is the output it generating without 'underline' beneath the Treatment header.

SASuserlot_0-1635194889101.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

Try this one:

 

ods rtf file='c:\temp\temp.rtf' style=journal bodytitle;
proc report data=sashelp.class nowd;
columns name age ("(*ESC*)S={borderbottomcolor=black borderbottomwidth=2}Treatment Group"  weight height);
define name/display;
run;
ods rtf close;

View solution in original post

6 REPLIES 6
ballardw
Super User

@SASuserlot wrote:

I am generating the tables using the proc report. I want to get a underline under the one of the 'Treatment' heading, I used this code  " '"^R/RTF'\brdrb\brdrs' "  in the column section however,  it not generating the underline covering the treatments. I need an underline beneath the 'Treatment'  covering all the treatments. Can you please suggest what I am doing wrong and other options to achieve it. Thanks.

 

This is the code I used in column section

 

column ("^R/RTF'\brdrb\brdrs '" sort col1 ("^R/RTF'\brdrb\brdrs' Treatment Group" trt1 trt2 trt3 trt4 ) );

 

This is the output it generating without 'underline' beneath the Treatment header.

SASuserlot_0-1635194889101.png

 


Because of the way many options interact in Proc Report it is suggested to always include the entire procedure code, not just one line. Especially not a line that doesn't work.

 

You might consider creating a dummy report appearance with a word processor or other program, creating an image of that appearance and sharing that as well. I pretty sure at this time that I do not know where you want "line".

SASuserlot
Barite | Level 11

Thanks for our response. I will try to post the sample code.

Ksharp
Super User

Try this one:

 

ods rtf file='c:\temp\temp.rtf' style=journal bodytitle;
proc report data=sashelp.class nowd;
columns name age ("(*ESC*)S={borderbottomcolor=black borderbottomwidth=2}Treatment Group"  weight height);
define name/display;
run;
ods rtf close;
SASuserlot
Barite | Level 11

It worked Ksharp. Thank you very much.

sps_sandy14
Calcite | Level 5

Hi,

 

We need to assign border width for the line you need for that report

'"^R/RTF'\brdrb\brdrs\brdrw' "

 

that W is the width of the border ,give 3 for that "w"

'"^R/RTF'\brdrb\brdrs\brdr3' "

Now it will work.Kindly check and update your comment.

 

KevinViel
Pyrite | Level 9

Similar to what Ksharp posted, I would consider an alternative, which might be more destination agnostic?  I am presenting a macro at PHUSE US Connect 2024 in paper SM04 that covers some of this and how to get adequate spacing between multiple headers of columns headers.  Consider:

 

 

`S={ borderbottomcolor = black
     borderbottomwidth = 1pt
     borderleftstyle   = none
     borderrightstyle  = none
   }

column page_order_1
       page_1
       section_order_1
       row_order_1
       row_1
       ( "`S={ borderbottomcolor = black borderbottomwidth = 1pt borderleftstyle = none borderrightstyle = none }Group 1`n(N = 10)"
         col1 
         col2
       )
       null1 
       ( "`S={ borderbottomcolor = black borderbottomwidth = 1pt borderleftstyle = none borderrightstyle = none }Group 2`n(N = 8)" 
         col3 
         col4 
       ) 
       null2 
       ( "`S={ borderbottomcolor = black borderbottomwidth = 1pt borderleftstyle = none borderrightstyle = none }All`n(N = 18)" 
         col5 
         col6
       ) 
       ;

I create the null_ variable using a compute block in REPORT and given them cellwidth = 0.25%.  They are missing values and have no borders.  A very important point is what TEMPLATE or STYLE overrides you employ.

 

HTH,

 

Kevin

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 6 replies
  • 5654 views
  • 3 likes
  • 5 in conversation