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

Ods layout isn't supported in ODS RTF.

I have tried ods region column_span=3 style={padding=0 margin=0}; to create 3 columns then do ods region column_span=1 style={width=4in padding=0 margin=0 just=l};

I have tried many things by I can't get the charts side by side.

I have a long code within ods html which contains proc ghart, proc sgplot etc. Some are side by side in the html file.

How can I recreate this within ods rtf?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

You want this ?

 

%let path= c:\temp ;

options nodate nonumber;
ods listing gpath="&path." style=htmlblue image_dpi=300;
ods graphics /width=3in height=3in reset=index noborder imagename='FAS' outputfmt=png ;
proc sgplot data=sashelp.class noautolegend ;
reg x=height y=weight/cli clm;
run;

ods graphics /width=3in height=3in reset=index noborder imagename='PPS' outputfmt=png;
proc sgplot data=sashelp.class;
scatter x=age y=weight;
run;

ods graphics /width=3in height=3in reset=index noborder imagename='SS' outputfmt=png ;
proc sgplot data=sashelp.class ;
ellipse x=height y=weight/group=sex;
scatter x=height y=weight/group=sex;
run;

ods graphics /width=3in height=3in reset=index noborder imagename='S' outputfmt=png;
proc sgplot data=sashelp.class;
scatter x=age y=weight/group=sex datalabel=name;
run;

ods rtf file="&path.\want.rtf" style=minimal dpi=300 ;
data x;
x=' ';y=' ';output;
x=' ';y=' ';output;
run;
title;
proc report data=x nowd noheader style={outputwidth=100% };
column x y;
define x/display;
define y/display;
compute y;
n+1;
if n=1 then do;
call define('x','style','style={ preimage="&path\FAS1.png" bordertopcolor=white borderbottomcolor=white borderrightcolor=white borderleftcolor=white}');
call define('y','style','style={ preimage="&path\PPS1.png" bordertopcolor=white borderbottomcolor=white borderrightcolor=white borderleftcolor=white}');
end;
if n=2 then do;
call define('x','style','style={ preimage="&path\SS1.png" bordertopcolor=white borderbottomcolor=white borderrightcolor=white borderleftcolor=white}');
call define('y','style','style={ preimage="&path\S1.png" bordertopcolor=white borderbottomcolor=white borderrightcolor=white borderleftcolor=white}');
end;
endcomp;
run;

ods rtf close;

Ksharp_0-1743229826959.png

 

View solution in original post

3 REPLIES 3
Ksharp
Super User

You want this ?

 

%let path= c:\temp ;

options nodate nonumber;
ods listing gpath="&path." style=htmlblue image_dpi=300;
ods graphics /width=3in height=3in reset=index noborder imagename='FAS' outputfmt=png ;
proc sgplot data=sashelp.class noautolegend ;
reg x=height y=weight/cli clm;
run;

ods graphics /width=3in height=3in reset=index noborder imagename='PPS' outputfmt=png;
proc sgplot data=sashelp.class;
scatter x=age y=weight;
run;

ods graphics /width=3in height=3in reset=index noborder imagename='SS' outputfmt=png ;
proc sgplot data=sashelp.class ;
ellipse x=height y=weight/group=sex;
scatter x=height y=weight/group=sex;
run;

ods graphics /width=3in height=3in reset=index noborder imagename='S' outputfmt=png;
proc sgplot data=sashelp.class;
scatter x=age y=weight/group=sex datalabel=name;
run;

ods rtf file="&path.\want.rtf" style=minimal dpi=300 ;
data x;
x=' ';y=' ';output;
x=' ';y=' ';output;
run;
title;
proc report data=x nowd noheader style={outputwidth=100% };
column x y;
define x/display;
define y/display;
compute y;
n+1;
if n=1 then do;
call define('x','style','style={ preimage="&path\FAS1.png" bordertopcolor=white borderbottomcolor=white borderrightcolor=white borderleftcolor=white}');
call define('y','style','style={ preimage="&path\PPS1.png" bordertopcolor=white borderbottomcolor=white borderrightcolor=white borderleftcolor=white}');
end;
if n=2 then do;
call define('x','style','style={ preimage="&path\SS1.png" bordertopcolor=white borderbottomcolor=white borderrightcolor=white borderleftcolor=white}');
call define('y','style','style={ preimage="&path\S1.png" bordertopcolor=white borderbottomcolor=white borderrightcolor=white borderleftcolor=white}');
end;
endcomp;
run;

ods rtf close;

Ksharp_0-1743229826959.png

 

Season
Barite | Level 11

That's terrific! I posted a complaint on the lack of flexibility of PROC SGPANEL in the community before. Your code is more complex than the code a usual SGPANEL procedure entails, but it's cool.

paul8
Fluorite | Level 6
Perfect! Thank you!
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
  • 3 replies
  • 1928 views
  • 6 likes
  • 3 in conversation