BookmarkSubscribeRSS Feed
ScottBass
Rhodochrosite | Level 12

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


tagsets_style_popup_runtime_error.png

Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
1 REPLY 1
Tim_SAS
Barite | Level 11

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".

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 740 views
  • 0 likes
  • 2 in conversation