Help using Base SAS procedures

How to remove the frame line and gridded lines from the tables that is PPT ods generated

Accepted Solution Solved
Reply
Contributor
Posts: 74
Accepted Solution

How to remove the frame line and gridded lines from the tables that is PPT ods generated

Hello!

 

 Would you please suggest me how to remove the frame line and gridded lines from the tables that is PPT ods generated. Thanks!


Accepted Solutions
Solution
‎11-11-2016 05:00 PM
Super Contributor
Posts: 394

Re: How to remove the frame line and gridded lines from the tables that is PPT ods generated

You forgot to specify your new style with the STYLE= option on your ODS POWERPOINT statement.

 

ods powerpoint file='/sas/goodresult.pptx' style=mystyle;

View solution in original post


All Replies
SAS Super FREQ
Posts: 8,743

Re: How to remove the frame line and gridded lines from the tables that is PPT ods generated

Hi:

  Using STYLE= overrides worked for me -- this approach would work for PROC PRINT, PROC REPORT and/or PROC TABULATE. Since you did not show any code, it is hard to comment with any more detail.

 

cynthia

 

ppt_no_lines.png

Contributor
Posts: 74

Re: How to remove the frame line and gridded lines from the tables that is PPT ods generated

Thank you so much, Cynthia!

Super Contributor
Posts: 394

Re: How to remove the frame line and gridded lines from the tables that is PPT ods generated

The table and cell borders are controlled by the Table and Data style classes. Set the borderwidth to 0 to eliminate the borders.

ods path (prepend) work.templat(update);
proc template;
	define style mystyle;
		parent=styles.powerpointlight;
		class Table, Data /
			borderwidth = 0 
			;
	end;
run;
ods powerpoint file="example.pptx" style=mystyle;
proc print data=sashelp.class(obs=6);
run;
ods powerpoint close;

example.jpg
Super Contributor
Posts: 394

Re: How to remove the frame line and gridded lines from the tables that is PPT ods generated

Oh, and you'll have to remove the borders in the Header class as well.

ods path (prepend) work.templat(update);
proc template;
	define style mystyle;
		parent=styles.powerpointlight;
		class Table, Data, Header /
			borderwidth = 0 
			;
	end;
run;
ods powerpoint file="example.pptx" style=mystyle;
proc print data=sashelp.class(obs=6);
run;
ods powerpoint close;
Contributor
Posts: 74

Re: How to remove the frame line and gridded lines from the tables that is PPT ods generated

 Hi Tm,

 

Do you know why I still cannot remove the frame line and gridded lines from my report table after adding the piece of code you just gave me. Please take a look at the sample code below. Thank you so much!

 

ods path (prepend) work.templat(update);
proc template;
define style mystyle;
parent=styles.powerpointlight;
class Table, Data, Header /
borderwidth = 0
;
end;
run;

goptions reset=all cback=white border htitle=4pt htext=7pt device=png vsize=3in ;
options orientation = landscape
papersize = letter
date
number

topmargin = 0.55in
bottommargin =0.1in
leftmargin = 0.8in
rightmargin = 0.1in;
ods noproctitle;
ods escapechar = "^";

footnote1 height=8pt color=darkgrey justify=right " special day ";
/*footnote2 height=8pt color=darkgrey justify=right " " ; */
title1 color= lightgrey justify=right height=8pt " good team " ;

ods powerpoint file='/sas/goodresult.pptx' ;
ods powerpoint layout=titleslide;
proc odstext;
p "&premon. Rate Update" / style=presentationtitle;

run;


ods powerpoint layout=_null_;

 

ods layout gridded columns=2 column_widths=(52% 48%) column_gutter=1pct;

title bold color= darkblue justify=left height=18pt " &premon. Metrics" ;
ods region ;


goptions reset=all cback=white border htitle=4pt htext=7pt device=png vsize=3in ;

 


Proc report data=joinsum2_1_a contents=" " nowd split='\'
style(header)={ just=center color=white background=cornflowerblue fontsize=0.9 font_weight=bold }
style(column)={ background=snow foreground=black fontsize=0.9} ;

column _name_ asof&premon. as&premon. BW ;

define _name_ / " Metric" style={cellwidth=1.8in } ;

define asof&premon./ " &Mar_Yr." style={ just=center cellwidth=0.65in };
define as&premon./ "&Mar_PreYr." style={ just=center cellwidth=0.65in };
define BW/ "#B(W)" style={ just=center foreground=negfmt. foreground=white};

 

 

compute _name_ ;

/* if _name_= 'Volume' then call define(_row_,'style','style={background=gainsboro }');*/
if _name_= 'Score' then call define(_row_,'style','style={background=gainsboro }');
if _name_= 'rate' then call define(_row_,'style','style={background=gainsboro}');
if _name_= 'ratio' then call define(_row_,'style','style={background=gainsboro}');
endcomp;
run;

Solution
‎11-11-2016 05:00 PM
Super Contributor
Posts: 394

Re: How to remove the frame line and gridded lines from the tables that is PPT ods generated

You forgot to specify your new style with the STYLE= option on your ODS POWERPOINT statement.

 

ods powerpoint file='/sas/goodresult.pptx' style=mystyle;
Contributor
Posts: 74

Re: How to remove the frame line and gridded lines from the tables that is PPT ods generated

Hi Tim,

 

Thank you so much for your reminder. Another thing is, what if I dont want to remove the frame line and gridded line from all tables, but some tables, can I homemake it?

 

Thanks a lot!

Super Contributor
Posts: 394

Re: How to remove the frame line and gridded lines from the tables that is PPT ods generated

Not using a style template. The style template applies to the the entire .pptx file, so if  the template removes the table/data/header borders then they're removed from all the tables. You can specify different border styles on the tables created by PROC REPORT, PRINT, and TABULATE using STYLE= options, as @Cynthia_sas demonstrated.

☑ This topic is SOLVED.

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

Discussion stats
  • 8 replies
  • 1802 views
  • 4 likes
  • 3 in conversation