BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
mmurph15
Fluorite | Level 6

Hi everyone - 

I'm struggling with figuring out the right code to place borders in one part of my header column in proc report. I simply want a thicker line to the right of each cell with a "Q4" in it (see yellow highlighting), but nothing I'm trying is working.  I know this must be a simple thing I'm missing - can someone take a very quick look at my code and help me out! So grateful, in advance.

 

mmurph15_0-1680025486082.png

 

 

CODE:

proc report data=all style(lines) = [background = grayEE] style(header)=[background=grayEE];
where grantee= "&G";
column strategy item2 ("^S={borderrightcolor=grey borderrightwidth=1}Year 1" Q02-Q04)
("^S={borderrightcolor=grey borderrightwidth=1}Year 2" Q05-Q08)
("^S={borderrightcolor=grey borderrightwidth=1}Year 3" Q09-Q12)
("^S={borderrightcolor=grey borderrightwidth=1}Year 4" Q13-Q16)
("Year 5" Q17-Q20);
define strategy/order "Strategy" noprint ;
define item2/display "Activity or Outcome" style(column)=[cellwidth=2in] left;
define Q02/display "Q2" style(column)=[cellwidth=.3in] center;
define Q03/display "Q3" style(column)=[cellwidth=.3in] center;
define Q04/display "Q4" style(column)=[cellwidth=.3in borderrightcolor=grey borderrightwidth=1] center; 
define Q05/display "Q1" style(column)=[cellwidth=.3in] center;
define Q06/display "Q2" style(column)=[cellwidth=.3in] center;
define Q07/display "Q3" style(column)=[cellwidth=.3in] center;
define Q08/display "Q4" style(column)=[cellwidth=.3in borderrightcolor=grey borderrightwidth=1] center;*removed from inside brackets ;
define Q09/display "Q1" style(column)=[cellwidth=.3in] center;
define Q10/display "Q2" style(column)=[cellwidth=.3in] center;
define Q11/display "Q3" style(column)=[cellwidth=.3in] center;
define Q12/display "Q4" style(column)=[cellwidth=.3in borderrightcolor=grey borderrightwidth=1] center;
define Q13/display "Q1" style(column)=[cellwidth=.3in] center;
define Q14/display "Q2" style(column)=[cellwidth=.3in] center;
define Q15/display "Q3" style(column)=[cellwidth=.3in] center;
define Q16/display "Q4" style(column)=[cellwidth=.3in borderrightcolor=grey borderrightwidth=1] center;
define Q17/display "Q1" style(column)=[cellwidth=.3in] center;
define Q18/display "Q2" style(column)=[cellwidth=.3in] center;
define Q19/display "Q3" style(column)=[cellwidth=.3in] center;
define Q20/display "Q4" style(column)=[cellwidth=.3in] center;
format Q02-Q20 blank.;
compute before strategy;
line strategy $stratname40. ;
endcomp;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  I'm not sure you can change the borders the way you envision with a style override. Also you're using "old style" style overrides for in-line formatting, and that may or many not work, depending on your destination, which you did not show. Are you wanting RTF, PDF or HTML or ??? I am pretty sure that you're not going to be able to change the borders like this if you want ODS EXCEL output.

  Do you only want the thicker line in the header??? Don't you want the thick line to go down the entire column?  Just curious, it would bother me to see a thicker line in the header that wasn't carried down the whole report. And it might not work, again, depending on your destination. Also a border width of 1 without a unit of measure is only 1 pixel, which is the default unit of measure, so that's not going to be very thick. Also, your description does not make sense to me. You are labelling variable Q08 and Q12, etc as Q4, And everything is a usage of DISPLAY which makes me wonder whether you've presummarized the data from some other structure into this structure for the report.

  Can you provide a bit more context for your report?

  This is how I would alter the borders if I wanted ODS HTML:

Cynthia_sas_0-1680027215707.png

 

Cynthia

View solution in original post

3 REPLIES 3
Cynthia_sas
SAS Super FREQ

Hi:

  I'm not sure you can change the borders the way you envision with a style override. Also you're using "old style" style overrides for in-line formatting, and that may or many not work, depending on your destination, which you did not show. Are you wanting RTF, PDF or HTML or ??? I am pretty sure that you're not going to be able to change the borders like this if you want ODS EXCEL output.

  Do you only want the thicker line in the header??? Don't you want the thick line to go down the entire column?  Just curious, it would bother me to see a thicker line in the header that wasn't carried down the whole report. And it might not work, again, depending on your destination. Also a border width of 1 without a unit of measure is only 1 pixel, which is the default unit of measure, so that's not going to be very thick. Also, your description does not make sense to me. You are labelling variable Q08 and Q12, etc as Q4, And everything is a usage of DISPLAY which makes me wonder whether you've presummarized the data from some other structure into this structure for the report.

  Can you provide a bit more context for your report?

  This is how I would alter the borders if I wanted ODS HTML:

Cynthia_sas_0-1680027215707.png

 

Cynthia

mmurph15
Fluorite | Level 6

Thanks so much, Cynthia. 

I'm hoping to output to PDF.

I do want the thicker lines going all the way from top to bottom, but I can't seem to get them in that one place (it's the break that's bugging me). 

Yes - all the data has been preprocessed, hence just the display variables.

 

mmurph15
Fluorite | Level 6
... and what you suggested to do for HTML worked!! (adding a style for the header after each "Q4" display variable...).
Thank you SO much. It is so very appreciated.

SAS Innovate 2025: Call for Content

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 936 views
  • 0 likes
  • 2 in conversation