<?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 Calling any ODS RTF expert: how to highlight or color-fill entire line? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Calling-any-ODS-RTF-expert-how-to-highlight-or-color-fill-entire/m-p/384053#M18989</link>
    <description>&lt;P&gt;So in my ODS RTF testing, it seems the first line worked with highlighting it entirely like you see in TEST TITLE 1.&amp;nbsp; However, it didn't work for TEST TITLE 2. How do I fix that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let outsy=E:\Users\pahn\Desktop\qb;

data qbdats;
input QB $ completed passes;
datalines;
Brett 23 35
Tom 21 29
Peyton 34 41
Eli 32 37
Aaron 26 38
;
run;

/* at this point main this is basically adding the _type_
   variable but would be appropriate if your data was 
   per game or similar
   A GROUP variable creates a stacked barchart with 
   separate colors for each level. If you only have
   on value for a group it stands out as desired.
*/
proc summary data=qbdats;
class QB;
var completed passes;
output out=qbsums sum=;
run;

data qb_pass_rate;
   set qbsums;
   completion_rate = completed/passes ;
   if missing(QB) then QB='Total';
run;

data attrmap;
   /* The ID required variable contains the name of the attribute map */
   /* The VALUE required variable contains the value of the GROUP variable, 
      which in this case is BARTYPE */
   /* The FILLCOLOR variable is used to change the color for the bars created by the VBAR 
      statement. */
   input id $ value fillcolor $;
   datalines;
_type_ 0 green
_type_ 1 blue
;
run;

%let defaulttablefont=font_face=Calibri fontsize=10pt;
ods noresults escapechar='^';

%let bc=cx7BA0CD;
%let bw=1;
%let breaklinesandwich=borderbottomcolor=&amp;amp;bc borderbottomwidth=&amp;amp;bw.pt bordertopcolor=&amp;amp;bc bordertopwidth=&amp;amp;bw.pt;
/*%let boxy=borderwidth=&amp;amp;bw.pt bordercolor=&amp;amp;bc;*/

%let titlestyle=borderwidth=&amp;amp;bw.pt bordercolor=&amp;amp;bc font_face=Calibri fontsize=12pt fontweight=bold background=cxD3DFEE;

ods path sasuser.templat(UPDATE)
       mylib.templat  (READ)
       sashelp.tmplmst(READ);

proc template;
  define style styles.test1;
	parent=styles.printer;
	style fonts /
	  'docFont'=("Calibri",10pt)
	  ;
	style Body from Document /
      marginbottom = 0.5in
      margintop = 1in
      marginright = 1in
      marginleft = 1in;
	style Table from Output /
/*      bordercollapse = separate*/
      rules = ALL
      cellpadding = 2pt
      borderspacing = 0.25pt
      borderwidth = 2pt
      borderstyle = solid
	  font=fonts('docFont');
	style header from table /
	  just=left
	  vjust=middle
	  fontweight=bold
	  background=white
	  borderbottomcolor=black
	  borderbottomwidth=2pt;
	class graph /
	  just=left;
  end;
run;

ods rtf file="&amp;amp;outsy\qb_stats.rtf" style=styles.test1 startpage=no;
options nocenter;

ods rtf text="^{newline}^{style[font_face=Calibri fontsize=11pt &amp;amp;breaklinesandwich]This report provides a 
summary of data collected for the QB passes in football. The task was issued to Pete in XXX game(s).}^{newline}";
ods rtf text="^{newline}";

ods rtf text="^S={&amp;amp;titlestyle}TEST TITLE 1: QB STATS";

/*ods rtf columns=2;*/

PROC REPORT DATA = qb_pass_rate(where=(qb^='Total')) MISSING nowd
	STYLE(REPORT)=[BACKGROUND=WHITE ASIS=ON just=l frame=box &amp;amp;defaulttablefont]
	style(column)=[&amp;amp;defaulttablefont]
	style(summary)=[fontweight=bold bordertopcolor=black bordertopwidth=2pt]
	;

COLUMN QB Completed passes pctComp;

COMPUTE qb;
	COUNT+1;
	IF (MOD(COUNT,2)) THEN CALL DEFINE (_ROW_, 'STYLE', 'STYLE=[BACKGROUND=cxD3DFEE]');
	IF _BREAK_="_RBREAK_" THEN qb = 'Total';
ENDCOMP;

DEFINE qb	/ "QB" ORDER=data center;
DEFINE Completed	/ "# caught"			center format=comma.;
DEFINE passes	/ "# of passes"				center format=comma.;
define pctComp / "Pass Completion Rate (%)" computed center	format=percent8.2;

compute pctComp;
  pctComp=completed.sum/passes.sum;
endcomp;

RBREAK AFTER / SUMMARIZE;
RUN;

ods graphics on / width=3.5in height=2.5in;
/*ods graphics / reset=index imagename='barchart1' imagefmt=jpg;*/
/*ods graphics / width=3.5in height=2.5in reset=index imagename='barchart1' imagefmt=jpg;*/
/*ods listing gpath="&amp;amp;outsy";*/

proc sgplot data= qb_pass_rate dattrmap=attrmap noautolegend;
  title; footnote;
  xaxis label = 'QB' labelattrs=(Family=Calibri Size=10 Weight=bold)
	type=discrete discreteorder=data display=(noticks);
  yaxis label='Pass Completion Rate (%)' labelattrs=(Family=Calibri Size=10 Weight=bold)
	tickvalueformat=percent6. grid gridattrs=(color=gray pattern=shortdash thickness=1);
   vbar qb / response= completion_rate group=_type_ attrid=_type_ datalabel datalabelattrs=(weight=bold);
  format completion_rate percent8.2;
run;


ods rtf text="^S={&amp;amp;titlestyle}TEST TITLE 2: BLABLABLA";
ods rtf text="^{unicode '25cf'x} ^{style[font_face=Calibri fontsize=11pt]blablabla1}";
ods rtf text="^{unicode '25cf'x} ^{style[font_face=Calibri fontsize=11pt]blablabla2}";
ods rtf text="^{unicode '25cf'x} ^{style[font_face=Calibri fontsize=11pt]blablabla3}";
/*ods graphics off;*/
/*ods listing close;*/

/*ods rtf columns=1;*/

ods rtf close;
ods _all_ close;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 30 Jul 2017 05:36:02 GMT</pubDate>
    <dc:creator>BigPete</dc:creator>
    <dc:date>2017-07-30T05:36:02Z</dc:date>
    <item>
      <title>Calling any ODS RTF expert: how to highlight or color-fill entire line?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Calling-any-ODS-RTF-expert-how-to-highlight-or-color-fill-entire/m-p/384053#M18989</link>
      <description>&lt;P&gt;So in my ODS RTF testing, it seems the first line worked with highlighting it entirely like you see in TEST TITLE 1.&amp;nbsp; However, it didn't work for TEST TITLE 2. How do I fix that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let outsy=E:\Users\pahn\Desktop\qb;

data qbdats;
input QB $ completed passes;
datalines;
Brett 23 35
Tom 21 29
Peyton 34 41
Eli 32 37
Aaron 26 38
;
run;

/* at this point main this is basically adding the _type_
   variable but would be appropriate if your data was 
   per game or similar
   A GROUP variable creates a stacked barchart with 
   separate colors for each level. If you only have
   on value for a group it stands out as desired.
*/
proc summary data=qbdats;
class QB;
var completed passes;
output out=qbsums sum=;
run;

data qb_pass_rate;
   set qbsums;
   completion_rate = completed/passes ;
   if missing(QB) then QB='Total';
run;

data attrmap;
   /* The ID required variable contains the name of the attribute map */
   /* The VALUE required variable contains the value of the GROUP variable, 
      which in this case is BARTYPE */
   /* The FILLCOLOR variable is used to change the color for the bars created by the VBAR 
      statement. */
   input id $ value fillcolor $;
   datalines;
_type_ 0 green
_type_ 1 blue
;
run;

%let defaulttablefont=font_face=Calibri fontsize=10pt;
ods noresults escapechar='^';

%let bc=cx7BA0CD;
%let bw=1;
%let breaklinesandwich=borderbottomcolor=&amp;amp;bc borderbottomwidth=&amp;amp;bw.pt bordertopcolor=&amp;amp;bc bordertopwidth=&amp;amp;bw.pt;
/*%let boxy=borderwidth=&amp;amp;bw.pt bordercolor=&amp;amp;bc;*/

%let titlestyle=borderwidth=&amp;amp;bw.pt bordercolor=&amp;amp;bc font_face=Calibri fontsize=12pt fontweight=bold background=cxD3DFEE;

ods path sasuser.templat(UPDATE)
       mylib.templat  (READ)
       sashelp.tmplmst(READ);

proc template;
  define style styles.test1;
	parent=styles.printer;
	style fonts /
	  'docFont'=("Calibri",10pt)
	  ;
	style Body from Document /
      marginbottom = 0.5in
      margintop = 1in
      marginright = 1in
      marginleft = 1in;
	style Table from Output /
/*      bordercollapse = separate*/
      rules = ALL
      cellpadding = 2pt
      borderspacing = 0.25pt
      borderwidth = 2pt
      borderstyle = solid
	  font=fonts('docFont');
	style header from table /
	  just=left
	  vjust=middle
	  fontweight=bold
	  background=white
	  borderbottomcolor=black
	  borderbottomwidth=2pt;
	class graph /
	  just=left;
  end;
run;

ods rtf file="&amp;amp;outsy\qb_stats.rtf" style=styles.test1 startpage=no;
options nocenter;

ods rtf text="^{newline}^{style[font_face=Calibri fontsize=11pt &amp;amp;breaklinesandwich]This report provides a 
summary of data collected for the QB passes in football. The task was issued to Pete in XXX game(s).}^{newline}";
ods rtf text="^{newline}";

ods rtf text="^S={&amp;amp;titlestyle}TEST TITLE 1: QB STATS";

/*ods rtf columns=2;*/

PROC REPORT DATA = qb_pass_rate(where=(qb^='Total')) MISSING nowd
	STYLE(REPORT)=[BACKGROUND=WHITE ASIS=ON just=l frame=box &amp;amp;defaulttablefont]
	style(column)=[&amp;amp;defaulttablefont]
	style(summary)=[fontweight=bold bordertopcolor=black bordertopwidth=2pt]
	;

COLUMN QB Completed passes pctComp;

COMPUTE qb;
	COUNT+1;
	IF (MOD(COUNT,2)) THEN CALL DEFINE (_ROW_, 'STYLE', 'STYLE=[BACKGROUND=cxD3DFEE]');
	IF _BREAK_="_RBREAK_" THEN qb = 'Total';
ENDCOMP;

DEFINE qb	/ "QB" ORDER=data center;
DEFINE Completed	/ "# caught"			center format=comma.;
DEFINE passes	/ "# of passes"				center format=comma.;
define pctComp / "Pass Completion Rate (%)" computed center	format=percent8.2;

compute pctComp;
  pctComp=completed.sum/passes.sum;
endcomp;

RBREAK AFTER / SUMMARIZE;
RUN;

ods graphics on / width=3.5in height=2.5in;
/*ods graphics / reset=index imagename='barchart1' imagefmt=jpg;*/
/*ods graphics / width=3.5in height=2.5in reset=index imagename='barchart1' imagefmt=jpg;*/
/*ods listing gpath="&amp;amp;outsy";*/

proc sgplot data= qb_pass_rate dattrmap=attrmap noautolegend;
  title; footnote;
  xaxis label = 'QB' labelattrs=(Family=Calibri Size=10 Weight=bold)
	type=discrete discreteorder=data display=(noticks);
  yaxis label='Pass Completion Rate (%)' labelattrs=(Family=Calibri Size=10 Weight=bold)
	tickvalueformat=percent6. grid gridattrs=(color=gray pattern=shortdash thickness=1);
   vbar qb / response= completion_rate group=_type_ attrid=_type_ datalabel datalabelattrs=(weight=bold);
  format completion_rate percent8.2;
run;


ods rtf text="^S={&amp;amp;titlestyle}TEST TITLE 2: BLABLABLA";
ods rtf text="^{unicode '25cf'x} ^{style[font_face=Calibri fontsize=11pt]blablabla1}";
ods rtf text="^{unicode '25cf'x} ^{style[font_face=Calibri fontsize=11pt]blablabla2}";
ods rtf text="^{unicode '25cf'x} ^{style[font_face=Calibri fontsize=11pt]blablabla3}";
/*ods graphics off;*/
/*ods listing close;*/

/*ods rtf columns=1;*/

ods rtf close;
ods _all_ close;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 30 Jul 2017 05:36:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Calling-any-ODS-RTF-expert-how-to-highlight-or-color-fill-entire/m-p/384053#M18989</guid>
      <dc:creator>BigPete</dc:creator>
      <dc:date>2017-07-30T05:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calling any ODS RTF expert: how to highlight or color-fill entire line?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Calling-any-ODS-RTF-expert-how-to-highlight-or-color-fill-entire/m-p/384063#M18990</link>
      <description>&lt;P&gt;You can use outputwidth=100% to make the highlighting extend across the entire line. &amp;nbsp;So that line of code becomes this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods rtf text="^S={outputwidth=100% &amp;amp;titlestyle}TEST TITLE 2: BLABLABLA";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Text-table-width/td-p/129071" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-Text-table-width/td-p/129071&lt;/A&gt; also shows the syntax if you want to add it to your style template. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jul 2017 13:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Calling-any-ODS-RTF-expert-how-to-highlight-or-color-fill-entire/m-p/384063#M18990</guid>
      <dc:creator>SuzanneDorinski</dc:creator>
      <dc:date>2017-07-30T13:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Calling any ODS RTF expert: how to highlight or color-fill entire line?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Calling-any-ODS-RTF-expert-how-to-highlight-or-color-fill-entire/m-p/384375#M18992</link>
      <description>&lt;P&gt;Thank you so much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 18:20:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Calling-any-ODS-RTF-expert-how-to-highlight-or-color-fill-entire/m-p/384375#M18992</guid>
      <dc:creator>BigPete</dc:creator>
      <dc:date>2017-07-31T18:20:19Z</dc:date>
    </item>
  </channel>
</rss>

