BookmarkSubscribeRSS Feed
sasrac
SAS Employee
Hi Experts,

Is there someone that have tried to insert a code in the list table in EG 4 to make the last row into Bold Font. Is there a code to make this condition?

Thanks,
sasrac
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
Both PROC PRINT (List Table) and PROC REPORT (List Report) have methods using code changes to highlight different areas on the report. This code method is known as coding a STYLE= override.

In PROC PRINT, a grand total or sub total line is automatically highlighted and bolded. So I'm not sure what you mean by the "last line" -- do you mean the last data observation or do you mean a summary line???

In PROC REPORT, on the other hand, the summary line at the grand total or sub total is not automatically highlighted and you can do that yourself using STYLE= overrides.

A simple program is shown below that illustrates the kind of code changes you'd need to do to highlight the last grand total line on a report. If you want to highlight the last entire ROW (as for William), you can only do that with PROC REPORT, using a CALL DEFINE statement in a COMPUTE block.

To change code in EG, you can preview the code in the Task or Wizard pane and then select INSERT CODE to find the places where you can insert code (or a STYLE= override). Alternately, you can export the code from a task, modify the code in a code node window and then submit the code from a code node window in the Project. (instead of using the Task)

cynthia
[pre]
ods _all_ close;
ods html file='compare_hilite.html' style=egdefault;

proc print data=sashelp.class
style(grandtotal)={background=pink};
title 'Proc Print';
var name sex age height weight;
sum age height weight ;
run;

proc report data=sashelp.class nowd
style(summary)={background=pink};
title 'Proc Report';
column name sex age height weight;
rbreak after/ summarize;
compute name;
if name = 'William' then do;
call define(_ROW_,'style',
'style={font_weight=bold background=yellow}');
end;
endcomp;
run;
ods html close;

[/pre]
sasrac
SAS Employee
Hi Cynthia,

Thanks for the suggestion.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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