Hello,
I'm in the process of migrating a reporting table entirely to a SAS output through ODS excel.
So far I have everything I previously had in the reporting layout that was done in excel, except for one thing.
I have a macro that alters the borderline of a row based on the cell value of a certain column (I have attached an example of this).
the report is pre-sorted, the macro just runs through the column and if it's the same value as the previous value (the one above in the sheet) the whole row is give a thin dotted bottomline. if not, there is a normal line (once again for the whole row of data).
I've already found how to de-activate the gridlines, and other layout stuff, but I have yet to find this one... any help much appreciated!
Many of us will not download attachments, especially Excel files which can be a security threat. Please show us a screen capture of the issue in Excel, use the "Insert Photos" icon (do not attach files).
Also, please show us the macro by copying the entire macro and pasting it into the window that appears when you click on the "little running man" icon.
as requested here is a screenshot of an example.
the code I use to generate the report is pretty basic
/*create sheet with links to enrollment*/
ODS EXCEL FILE=&linkr style=htmlblue options(
frozen_headers="ON" autofilter = "1-9" row_heights="30,13,13,13,13,13,13" flow = "header, data"
absolute_column_width = "18,27,12,12,56,10,21,21"
sheet_name = "&namer"
) ;
PROC report DATA=rep_&campaign nowd;
columns col1 col2 col3 col4 col5 link;
define col1 /
style(header)={just=center }
style(column)={just=center};
define col2 /
style(header)={just=center }
style(column)={just=center};
compute col3;
call define(_col_,'url',link);
if substr(col2,1,1) = 'P' THEN CALL DEFINE(_col_, "style", "STYLE=[BACKGROUND=cxFFFF99 textdecoration=underline color=blue]");
if substr(col2,1,1) = 'A' THEN CALL DEFINE(_col_, "style", "STYLE=[BACKGROUND=lightgreen textdecoration=underline color=blue]");
if substr(col2,1,1) = 'R' THEN CALL DEFINE(_col_, "style", "STYLE=[BACKGROUND=lightred textdecoration=underline color=blue]");
endcomp;
define link / noprint;
RUN ;
ODS _all_ CLOSE;
Nothing matches your original description. You mentioned a macro, but you don't show a macro. The code you show changes colors, decoration and background colors, but the Excel screen capture shows none of that. Your Excel screen capture shows INFO1 through INFO5, but your code shows none of that.
Please provide screen captures and code that are consistent with each other and consistent with your original explanation.
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!
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.