Desktop productivity for business analysts and programmers

Making the last row of the table into a Bold Font (EG 4)

SAS Employee
Posts: 16

Making the last row of the table into a Bold Font (EG 4)

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?

Posts: 8,721

Re: Making the last row of the table into a Bold Font (EG 4)

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)

ods _all_ close;
ods html file='compare_hilite.html' style=egdefault;

proc print data=sashelp.class
title 'Proc Print';
var name sex age height weight;
sum age height weight ;

proc report data=sashelp.class nowd
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}');
ods html close;

SAS Employee
Posts: 16

Re: Making the last row of the table into a Bold Font (EG 4)

Hi Cynthia,

Thanks for the suggestion.
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation