BookmarkSubscribeRSS Feed
sum_sand
Calcite | Level 5

ods path (prepend) work.template(update) sashelp.tmplmst;


proc template;
define style custom_style;
parent=styles.pearl;
style Document /
margin=0.3in;
style Table /
bordercolor=cxB0B7BB
borderwidth=0.5pt
borderstyle=solid;
class Header /
backgroundcolor=lightblue height=40; /* Optional: Change header background color */
class fonts /
'TitleFont' = ("<MTsans-serif>, Albany",14pt,bold)
'TitleFont2' = ("<MTsans-serif>, Albany",14pt,medium italic)
'docFont' = ("<MTsans-serif>, Albany",8pt);


end;
run;


title;
options nodate nonumber orientation=landscape papersize=letter topmargin=.25in bottommargin=.25in leftmargin=.25in rightmargin=.25in;

/* Generate PDF report */
ods pdf file="&path.\dummy..pdf"
notoc
style=custom_style
startpage=no;

/* Create the report */
proc report data=sashelp.class;
columns sex name ;
compute name;
if sex='F' then call define(_col_,'style', 'style={background=pink}');
else if sex='M' then call define(_col_, 'style', 'style={background=cyan}');
endcomp;

run;

ods pdf close; /* Close the PDF destination */

2 REPLIES 2
ballardw
Super User

And the question is what exactly?

 


@sum_sand wrote:

ods path (prepend) work.template(update) sashelp.tmplmst;


proc template;
define style custom_style;
parent=styles.pearl;
style Document /
margin=0.3in;
style Table /
bordercolor=cxB0B7BB
borderwidth=0.5pt
borderstyle=solid;
class Header /
backgroundcolor=lightblue height=40; /* Optional: Change header background color */
class fonts /
'TitleFont' = ("<MTsans-serif>, Albany",14pt,bold)
'TitleFont2' = ("<MTsans-serif>, Albany",14pt,medium italic)
'docFont' = ("<MTsans-serif>, Albany",8pt);


end;
run;


title;
options nodate nonumber orientation=landscape papersize=letter topmargin=.25in bottommargin=.25in leftmargin=.25in rightmargin=.25in;

/* Generate PDF report */
ods pdf file="&path.\dummy..pdf"
notoc
style=custom_style
startpage=no;

/* Create the report */
proc report data=sashelp.class;
columns sex name ;
compute name;
if sex='F' then call define(_col_,'style', 'style={background=pink}');
else if sex='M' then call define(_col_, 'style', 'style={background=cyan}');
endcomp;

run;

ods pdf close; /* Close the PDF destination */


 

sum_sand
Calcite | Level 5

Key explaining colors - what each color represents.

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
  • 2 replies
  • 233 views
  • 0 likes
  • 2 in conversation