<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Controlling borders in PROC REPORT and ODS Excel in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Controlling-borders-in-PROC-REPORT-and-ODS-Excel/m-p/755486#M25125</link>
    <description>&lt;P&gt;Since it appears to be a conditional border, that can be done by adding a new variable prior to reporting. This variable is set to 1 for the last entry of each group. See code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
set sashelp.cars (keep=Make Model MSRP MPG_City MPG_Highway);
    where Model in (' A4 1.8T 4dr' ' 325i 4dr');
    MPG = MPG_City; output;
    MPG = MPG_Highway; output;
run;
data test2;
set test (in=a) test (in=b);
    if a then year = '2019';
    if b then year = '2020';
run;

PROC SORT data=test2;
BY Make year;
RUN;

DATA test3;
SET test2;
BY Make year NOTSORTED;
IF LAST.Make or last.year THEN rowline=1;
RUN;

ods excel file="H:\Sample Proc Report.xlsx";
proc report data=test3 nowd spanrows style(hdr)=[fontfamily="Arial" fontsize=9pt foreground=white background=darkblue just=c] 
    style(lines)=[fontfamily="Arial" fontsize=9pt just=c borderbottomwidth=0 borderbottomstyle=hidden bordertopwidth=0 bordertopstyle=hidden]
    ;
    title "Title";
    columns ("Header1" Year Make ("Header2" MPG) MSRP) rowline;
        define Year / "Year" group order=data style(column)=[cellwidth=.65in];
        define Make / "Make" group order=data style(column)=[cellwidth=.4in];
        define MPG / "MPG" display style(column)=[cellwidth=.65in borderbottomcolor=white bordertopcolor=white] ;
        define MSRP / "MSRP" group style(column)=[cellwidth=.65in];
		DEFINE ROWLINE / ANALYSIS NOPRINT;
	COMPUTE rowline;
		 if rowline.sum=1 then
		 CALL DEFINE (_row_,'style',
		 'style=[borderbottomcolor=lightgrey' ) ;
	ENDCOMP;
	
    compute after Make / style=[bordertopcolor=black bordertopwidth=1pt bordertopstyle=solid borderbottomcolor=black borderbottomwidth=1pt borderbottomstyle=solid];
        call define(_row_,'style','style=[bordertopstyle=solid bordertopwidth=1pt bordertopcolor=black borderbottomstyle=solid borderbottomwidth=1pt borderbottomcolor=black]');
    endcomp;
    compute after/style=[just=l fontfamily="Arial" color=black backgroundcolor=white borderbottomstyle=hidden borderleftstyle=hidden borderrightstyle=hidden];
        line "Footer goes here.";
    endcomp;
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="output.png" style="width: 331px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61470iC516F2E6D23057A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="output.png" alt="output.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jul 2021 21:13:34 GMT</pubDate>
    <dc:creator>Rydhm</dc:creator>
    <dc:date>2021-07-20T21:13:34Z</dc:date>
    <item>
      <title>Controlling borders in PROC REPORT and ODS Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Controlling-borders-in-PROC-REPORT-and-ODS-Excel/m-p/755418#M25121</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am attempting final formatting on reports generated using PROC REPORT and ODS Excel. I am trying to remove borders that appear between two rows from grouped data, like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bstarr_0-1626800362765.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61431i71E6DBD31514C531/image-size/medium?v=v2&amp;amp;px=400" role="button" title="bstarr_0-1626800362765.png" alt="bstarr_0-1626800362765.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
set sashelp.cars (keep=Make Model MSRP MPG_City MPG_Highway);
    where Model in (' A4 1.8T 4dr' ' 325i 4dr');
    MPG = MPG_City; output;
    MPG = MPG_Highway; output;
run;
data test2;
set test (in=a) test (in=b);
    if a then year = '2019';
    if b then year = '2020';
run;

ods excel file="C:\Sample Proc Report.xlsx";
proc report data=test2 nowd spanrows style(hdr)=[fontfamily="Arial" fontsize=9pt foreground=white background=darkblue just=c] 
    style(lines)=[fontfamily="Arial" fontsize=9pt just=c borderbottomwidth=0 borderbottomstyle=hidden bordertopwidth=0 bordertopstyle=hidden];
    title "Title";
    columns ("Header1" Year Make ("Header2" MPG) MSRP);
        define Year / "Year" group order=data style(column)=[cellwidth=.65in];
        define Make / "Make" group order=data style(column)=[cellwidth=.4in];
        define MPG / "MPG" display style(column)=[cellwidth=.65in /*borderbottomstyle=hidden bordertopstyle=hidden*/];
        define MSRP / "MSRP" group style(column)=[cellwidth=.65in];
    compute after Make / style=[bordertopcolor=black bordertopwidth=1pt bordertopstyle=solid borderbottomcolor=black borderbottomwidth=1pt borderbottomstyle=solid];
        call define(_row_,'style','style=[bordertopstyle=solid bordertopwidth=1pt bordertopcolor=black borderbottomstyle=solid borderbottomwidth=1pt borderbottomcolor=black]');
    endcomp;
    compute after/style=[just=l fontfamily="Arial" color=black backgroundcolor=white borderbottomstyle=hidden borderleftstyle=hidden borderrightstyle=hidden];
        line "Footer goes here.";
    endcomp;
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I've commented out a portion on the "define MPG" row that when uncommented, removes ALL borders for that column (but the borders don't reappear in my "compute after Make" block). So I can either remove all row borders for that column, or leave all row borders in - I can't seem to remove those alternating row borders.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Brian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 17:12:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Controlling-borders-in-PROC-REPORT-and-ODS-Excel/m-p/755418#M25121</guid>
      <dc:creator>bstarr</dc:creator>
      <dc:date>2021-07-20T17:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling borders in PROC REPORT and ODS Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Controlling-borders-in-PROC-REPORT-and-ODS-Excel/m-p/755458#M25123</link>
      <description>your problem seems similar to this one:&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/BORDER-ods-Excel-Proc-report-break-after-column/td-p/453471" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/BORDER-ods-Excel-Proc-report-break-after-column/td-p/453471&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Try the above solution.&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Jul 2021 18:40:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Controlling-borders-in-PROC-REPORT-and-ODS-Excel/m-p/755458#M25123</guid>
      <dc:creator>Rydhm</dc:creator>
      <dc:date>2021-07-20T18:40:17Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling borders in PROC REPORT and ODS Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Controlling-borders-in-PROC-REPORT-and-ODS-Excel/m-p/755474#M25124</link>
      <description>&lt;P&gt;Thanks for referencing that question/solution. Unfortunately, that code marked as a solution does not appear to work, at least in my version of SAS (9.4&amp;nbsp;TS1M6). It throws errors, and when I fix some of the errors, it still trips up saying that the subroutine "style" is unknown. The next logical leap I can think of is to use call define style, which I've already tried.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 19:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Controlling-borders-in-PROC-REPORT-and-ODS-Excel/m-p/755474#M25124</guid>
      <dc:creator>bstarr</dc:creator>
      <dc:date>2021-07-20T19:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling borders in PROC REPORT and ODS Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Controlling-borders-in-PROC-REPORT-and-ODS-Excel/m-p/755486#M25125</link>
      <description>&lt;P&gt;Since it appears to be a conditional border, that can be done by adding a new variable prior to reporting. This variable is set to 1 for the last entry of each group. See code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
set sashelp.cars (keep=Make Model MSRP MPG_City MPG_Highway);
    where Model in (' A4 1.8T 4dr' ' 325i 4dr');
    MPG = MPG_City; output;
    MPG = MPG_Highway; output;
run;
data test2;
set test (in=a) test (in=b);
    if a then year = '2019';
    if b then year = '2020';
run;

PROC SORT data=test2;
BY Make year;
RUN;

DATA test3;
SET test2;
BY Make year NOTSORTED;
IF LAST.Make or last.year THEN rowline=1;
RUN;

ods excel file="H:\Sample Proc Report.xlsx";
proc report data=test3 nowd spanrows style(hdr)=[fontfamily="Arial" fontsize=9pt foreground=white background=darkblue just=c] 
    style(lines)=[fontfamily="Arial" fontsize=9pt just=c borderbottomwidth=0 borderbottomstyle=hidden bordertopwidth=0 bordertopstyle=hidden]
    ;
    title "Title";
    columns ("Header1" Year Make ("Header2" MPG) MSRP) rowline;
        define Year / "Year" group order=data style(column)=[cellwidth=.65in];
        define Make / "Make" group order=data style(column)=[cellwidth=.4in];
        define MPG / "MPG" display style(column)=[cellwidth=.65in borderbottomcolor=white bordertopcolor=white] ;
        define MSRP / "MSRP" group style(column)=[cellwidth=.65in];
		DEFINE ROWLINE / ANALYSIS NOPRINT;
	COMPUTE rowline;
		 if rowline.sum=1 then
		 CALL DEFINE (_row_,'style',
		 'style=[borderbottomcolor=lightgrey' ) ;
	ENDCOMP;
	
    compute after Make / style=[bordertopcolor=black bordertopwidth=1pt bordertopstyle=solid borderbottomcolor=black borderbottomwidth=1pt borderbottomstyle=solid];
        call define(_row_,'style','style=[bordertopstyle=solid bordertopwidth=1pt bordertopcolor=black borderbottomstyle=solid borderbottomwidth=1pt borderbottomcolor=black]');
    endcomp;
    compute after/style=[just=l fontfamily="Arial" color=black backgroundcolor=white borderbottomstyle=hidden borderleftstyle=hidden borderrightstyle=hidden];
        line "Footer goes here.";
    endcomp;
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="output.png" style="width: 331px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61470iC516F2E6D23057A4/image-size/large?v=v2&amp;amp;px=999" role="button" title="output.png" alt="output.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 21:13:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Controlling-borders-in-PROC-REPORT-and-ODS-Excel/m-p/755486#M25125</guid>
      <dc:creator>Rydhm</dc:creator>
      <dc:date>2021-07-20T21:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling borders in PROC REPORT and ODS Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Controlling-borders-in-PROC-REPORT-and-ODS-Excel/m-p/755489#M25126</link>
      <description>&lt;P&gt;Yes that is perfect, thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 21:46:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Controlling-borders-in-PROC-REPORT-and-ODS-Excel/m-p/755489#M25126</guid>
      <dc:creator>bstarr</dc:creator>
      <dc:date>2021-07-20T21:46:33Z</dc:date>
    </item>
  </channel>
</rss>

