The SAS Output Delivery System and reporting techniques

Change Column Header Color Proc Report

Reply
New User
Posts: 1

Change Column Header Color Proc Report

Hello,

I am using proc report with across variables, and I am trying to alternate the column header color in the report, but have been unsuccessful. I have attached a picture of how my current report looks, and how I would like it to look. I am using Excel to output the report.

My code resembles this (I left out some code to save space):

data summary;

     input month rank login_id current_status pct solved solved_age unsolved unsolved_age;

     19667 1 AAA Stat1 .2523 27 5.57 63 7.93

     19667 1 AAA Stat2 .0093 1 3.96 3 5.04;

...

run;

data summary;

     set summary;

     if current_status = 'AAA' then do;

          sort=1;

          month_sort = month;

          month = dhms(month,0,0,0);

          rank_sort=rank;

          login_id_sort=login_id;

...

run;

Proc Report NOWD MISSING data=summary HEADLINE HEADSKIP STYLE=[RULES=all FRAME=box] split = '|';

  Columns          month_sort

  rank_sort

  login_id_sort

  month

  login_id

  rank

  (sort,Current_status),

  (pct)

  (sort,Current_status),

  (solved

  solved_age

  unsolved

  unsolved_age)

;

  define month_sort / group order=internal descending noprint;

  define rank_sort / group order=internal noprint;

  define login_id_sort / group order=internal noprint;

  define month / group 'Month' style(COLUMN)={tagattr='typeSmiley Very HappyateTime format:MMM YYYY'};

  define login_id / group 'ID';

  define rank / group 'Rank';

  define sort / '' across order=internal style={tagattr='Hidden:Yes'};

  define Current_status / '' across;

  define pct / analysis nozero 'Pct' style={BACKGROUNDCOLOR=#601d1d FONT_SIZE=9pt Foreground=white Font_Weight=bold} style(COLUMN)={tagattr='type:Number format:#,##0.00%'};

  define sort / '' across order=internal style={tagattr='Hidden:Yes'};

  define Current_status / '' across;

  define solved / analysis nozero 'Solved';

  define solved_age / analysis nozero 'Solved Age' style(COLUMN)={tagattr='type:Number format:#,##0.00'};

  define unsolved / analysis nozero 'UnSolved';

  define unsolved_age / analysis nozero 'UnSolved Age' style(COLUMN)={tagattr='type:Number format:#,##0.00'};

  compute rank_sort;

  if rank_sort = 9999 then do;

  rank_sort = rank_sort;

  call define(_row_, 'style', "style=[foreground=#FFFFFF background=#002C5F font_weight=bold font_size=8pt] ");

  end;

  endcomp;

  format month IS8601DT.;

run;

    

Please let me know if you need anymore information, and thank you in advance.


Current Report.PNGDesired output.PNG
Ask a Question
Discussion stats
  • 0 replies
  • 586 views
  • 0 likes
  • 1 in conversation