I am trying to color the last row to light blue which is my Total Row.
Below is my code to create my Proc report:
proc report split='~' data=Table3_Final out=Table3_Final_1 spanrows style(header)=[fontweight=bold background=lightblue foreground=black]
style(column)=[font_face='Calibri' fontsize=11pt] style(summary)=[background=lightblue];
column Status P4 P3 P2 P1 C2 C3 C4;
define Status / Display "" style(column)=[cellwidth=25% textalign=center just=decimal];
define P1 / Analysis "&Period_1" style(column)=[cellwidth=25% textalign=center just=decimal];
define P2 / Analysis "&Period_2" style(column)=[cellwidth=25% textalign=center just=decimal];
define P3 / Analysis "&Period_3" style(column)=[cellwidth=25% textalign=center just=decimal];
define P4 / Analysis "&Period_4" style(column)=[cellwidth=25% textalign=center just=decimal];
define C2/ Analysis "C2" style(column)=[cellwidth=25% textalign=center just=decimal];
define C3/ Analysis " C3" style(column)=[cellwidth=25% textalign=center just=decimal];
define C4/ Analysis "C4" style(column)=[cellwidth=25% textalign=center just=decimal];
title1 justify=l 'Title1';
endcomp;
run;
Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel as example data we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.
Some things you need to look at in the posted code and make sure it is what you meant to post.
1) There is nothing creating a summary. I would expect to see some sort of Rbreak after/ summarize; to create a default end of table summary.
2) You have an ENDCOMP without a compute block start which I expect throws an error and generates no output.
Do you mean something like this:
proc report data=sashelp.class;
rbreak after / summarize style=header;
compute after ;
name = "Total";
endcomp;
run;
You need post some dummy data to let us test your code . proc report data=sashelp.heart nowd; column bp_status weight height; define bp_status/group; define weight/analysis sum; define height/analysis sum; compute height; if bp_status='Optimal' then call define(_row_,'style','style={background=verylightblue}'); endcomp; run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: