Hi,
ods path work.template (update) sashelp.tmplmst (read);
proc template;
define style mystyle;
parent=styles.normal;
class Header /
font=('Arial')
background=#009DE0
foreground=white
;
class Summary /
font_weight=bold
background=#D4D4D4
;
end;
run;
filename temp temp;
ods _all_ close;
ods escapechar="^";
ods pdf file=temp notoc style=mystyle;
proc report data=sashelp.class (obs=5) nowd spanrows;
columns name height weight;
rbreak after / summarize;
compute after;
name="Total";
endcomp;
quit;
proc report data=sashelp.class (firstobs=6) nowd spanrows style(summary)={background=#D4D4D4 font_weight=bold};
columns name height weight;
rbreak after / summarize;
compute after;
name="Total";
endcomp;
quit;
ods pdf close;
Why does the first PROC REPORT, using only the style definition, not print the summary line as bold/gray, while the second PROC REPORT, using the style statement, does?
Also, is there documentation/SGF paper that lists ALL the classes (header, rowheader, summary, etc) used in PROC REPORT? I know I could use tagsets.style_popup and HTML output, but I'd prefer to just lookup the style elements. I also get the attached error dialog when using the style_popup tagset.
Thanks,
Scott
The word "summary" in the style(summary) option refers to the summary location in the report, not the name of a style element. By default PROC REPORT uses the DataEmphasis style element for the summary location. Change class Summary to class DataEmphasis in your first example and it works as you expect.
The documentation for this is here: http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146851.htm#a00053.... Notice in particular the 2nd table, labeled
"Locations and Default Style Elements for Each Statement in PROC REPORT".
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.