The SAS Output Delivery System and reporting techniques

ods rtf column width question

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

ods rtf column width question

Hi,

 

I need help with ODS RTF template, proc report column width. I would like to control column width in output. But somehow all spaces are truncating.

 

Below is my code,

 

options orientation = landscape ls=140 ps=45 nocenter nobyline nodate nonumber ;
options noxwait noxsync mlogic nosymbolgen mprint missing = '' formchar='|_---|+|---+=|-/\<>*' ;

proc template;
define style myrtfstyle;
parent=styles.rtf;
style Table from output /
background=_undef_
Rules=groups
Frame=void
just=center
font=("Courier New", 9pt)
cellpadding = 1pt
cellspacing = 0pt
borderwidth = 0.5pt ;

style rowheader /
background=white
font=("Courier New", 11pt, bold)
;
style header /
background=white
font=("Courier New", 8.5pt, bold)
;
style systemtitle /
font=("Courier New", 8.5pt, bold)
;
style systemfooter /
font=("Courier New", 8.5pt, bold)
asis=on
;
style data /
font=("Courier New", 8.5pt)
;
replace Body from Document
"Controls the Body file." /
bottommargin = 1 in
topmargin = 1.25 in
rightmargin = 0.6 in
leftmargin = 0.8 in
;
end;
run;

ods escapechar="^";

data class;
set sashelp.class;
if name="Alice" then name=" Alice";
run;

ods listing close;
ods rtf file="U:\delete\output.rtf" style=myrtfstyle;

proc report data=class nocenter headline headskip missing split="~" spacing=10 nowd;
column name sex age height weight;

define name / display order "Name" left width=40 ;
define sex / display "Sex" left width=40 flow;
define age / display "Age" left width=40 flow;
define height / "Height" left width=40 flow;
define weight / "Weight" left width=40 flow;

break after name /skip;

title1 j=c "Summary Body Weight (kg) by Visit" j=r "page ^{pageof}";
footnote1 j=c "%sysget(SAS_EXECFILENAME)";
run;

 

ods rtf close;
ods listing;

 

Thanks in advance.

Saurabh


Capture.JPG

Accepted Solutions
Solution
‎01-09-2017 10:12 AM
Super User
Super User
Posts: 7,686

Re: ods rtf column width question

Yes, good idea to formulate your questions clearly, giving examples.  Skip does not do anything in ods rtf, have a read of Cynthia's post in:

https://communities.sas.com/t5/SAS-Enterprise-Guide/Break-and-Skip-statement/td-p/56082

 

You can emulate the skip by adding a compute + line " "; + endcomp;.

 

View solution in original post


All Replies
Super User
Super User
Posts: 7,686

Re: ods rtf column width question

So, you have put spaces before the word "Alice" yes, and you want them to show in your output.  Then you need to update this line:

define name / display order "Name" left width=40 ;

 

To read:

define name / display order "Name" left width=40 style={asis=on};

 

Its a tricky option to find any information on this one.

Occasional Contributor
Posts: 5

Re: ods rtf column width question

Hello,

 

Thank you so much for your inputs, yes with option asis=on working, But break after/skip options is still not working.

 

Regards,

Saurabh

Solution
‎01-09-2017 10:12 AM
Super User
Super User
Posts: 7,686

Re: ods rtf column width question

Yes, good idea to formulate your questions clearly, giving examples.  Skip does not do anything in ods rtf, have a read of Cynthia's post in:

https://communities.sas.com/t5/SAS-Enterprise-Guide/Break-and-Skip-statement/td-p/56082

 

You can emulate the skip by adding a compute + line " "; + endcomp;.

 

Occasional Contributor
Posts: 5

Re: ods rtf column width question

Thank you so much for your help and solution.

 

 

☑ This topic is solved.

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

Discussion stats
  • 4 replies
  • 504 views
  • 0 likes
  • 2 in conversation