The SAS Output Delivery System and reporting techniques

ODS TAGSETS.RTF: A lower border for the heading spanning two columns

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 12
Accepted Solution

ODS TAGSETS.RTF: A lower border for the heading spanning two columns

[ Edited ]

Hi,

 

What do I have to change in the following SAS program in order to add the lower border to the heading cell ("Powers") that spans two columns:

 

%macro fontSpecs();
	   FONT_FACE = "SAS Monospace"
	   FONT_SIZE = 7pt
	   FONT_WEIGHT = medium
	   FONT_STYLE = roman
	   FOREGROUND = black
	   BACKGROUND = white
%mend;
proc template;
	define style mystyle;
	parent = Styles.rtf;
	STYLE Continued from Continued/ pretext="" font=("SAS Monospace", 0pt) width=0% FOREGROUND=white;
	STYLE parskip from parskip / font =("Arial", 1pt);
	STYLE SystemTitle  / %fontSpecs();
	STYLE Header       / %fontSpecs() ;
	STYLE Data         / %fontSpecs() ;
	STYLE SystemFooter / %fontSpecs();
	STYLE Table        / %fontSpecs()
	   BORDERWIDTH = 1
	   CELLSPACING = 0pt
	   CELLPADDING = 0pt
	   FRAME = ABOVE
	   RULES = GROUPS
	;
	STYLE SysTitleAndFooterContainer /
 		CELLSPACING=0; 
	end;
run;

 

title "What I have now:"; title2; title3; title4; title5;
ods listing close;
ods  escapechar="^";
ods tagsets.rtf file="C:\test.rtf"  style=mystyle;
	data one; do x = 1 to 10; y = x ** 2; z = x ** 3; output; end; run;
	proc report data=one
	            nowindows missing
	            split='|' contents=''
	            style(column)={foreground=black cellspacing=1 just=C VJUST=M }
				style(report)=[font_face='SAS Monospace']
		; 
		columns x ("Powers" y z) ;
		%macro heaColStyle(hjust, cjust, width);
			DISPLAY	
			style(header)=[font_face='SAS Monospace' just=&hjust.] 
			style(column)=[font_face='SAS Monospace' cellwidth=&width.cm just=&cjust.]
		%mend;
		define x / %heaColStyle(c, c, 2.0  ) "X" id;
		define y / %heaColStyle(c, c, 2.0  ) "Y" ;
		define z / %heaColStyle(c, c, 2.0  ) "Z" ;
	run;
ods tagsets.rtf close;
ods listing ;
footnote; footnote2; footnote3; footnote4; footnote5; footnote6; 

 

 

 

Thanks in advanceWhat I have and what I want.png

 

I use SAS 9.2. Thanks in advance !

-- rkk33

Attachment

Accepted Solutions
Solution
‎03-23-2016 10:05 AM
Super User
Super User
Posts: 7,968

Re: ODS TAGSETS.RTF: A lower border for the heading spanning two columns

[ Edited ]

Where you specify the subheading, add in the rtf codes necessary to get the underline: 

ods escapechar="^";
proc report...;
  columns x ("^R'\brdrb\brdrs\brdrw15 'Powers" y z) ;
...

 

View solution in original post


All Replies
Occasional Contributor
Posts: 12

Re: ODS TAGSETS.RTF: A lower border for the heading spanning two columns

[ Edited ]

Schucks. My SAS code gets truncated. My entire SAS code is in the attachment.

Thanks !

-- rkk33

 

 

Attachment
Solution
‎03-23-2016 10:05 AM
Super User
Super User
Posts: 7,968

Re: ODS TAGSETS.RTF: A lower border for the heading spanning two columns

[ Edited ]

Where you specify the subheading, add in the rtf codes necessary to get the underline: 

ods escapechar="^";
proc report...;
  columns x ("^R'\brdrb\brdrs\brdrw15 'Powers" y z) ;
...

 

Occasional Contributor
Posts: 12

Re: ODS TAGSETS.RTF: A lower border for the heading spanning two columns

Hi RW9, Thanks a lot. I am going to try it now. -- rkk3

Occasional Contributor
Posts: 12

Re: ODS TAGSETS.RTF: A lower border for the heading spanning two columns

It works perfectly. Thanks!
SAS Super FREQ
Posts: 8,866

Re: ODS TAGSETS.RTF: A lower border for the heading spanning two columns

Hi:

  As an additional comment, for folks who want to do this but who need HTML or PDF, there is a style attribute called "textdecoration" that you can use with ODS ESCAPECHAR and STYLE=JOURNAL to achieve the same result in other destinations. See the code below.

 

cynthia

 

    data one; do x = 1 to 10; y = x ** 2; z = x ** 3; output; end; run;

    title; footnote;
       
    ods escapechar='^';
    ods tagsets.rtf file="C:\temp\test.rtf"  style=journal;
    ods pdf file="c:\temp\test.pdf" style=journal;
    ods html file="c:\temp\test.html" style=journal;
 
    proc report data=one
                nowindows missing
                style(report)={font_face="SAS Monospace" font_size=7pt font_style=roman}
                style(header)={font_face="SAS Monospace" font_size=7pt font_style=roman font_weight=bold}
                style(column)={font_face="SAS Monospace" font_size=7pt font_stype=roman};
        columns x ("^{style[textdecoration=underline]Powers}" y z) ;
    run;
ods tagsets.rtf close;
ods pdf close;
ods html close;

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 565 views
  • 2 likes
  • 3 in conversation