<?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: How to change the sub header styles in proc tabulate using a custom template? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-change-the-sub-header-styles-in-proc-tabulate-using-a/m-p/873856#M26285</link>
    <description>&lt;P&gt;That is coming from the part of the Table statement I have commented out below. I do not think you need that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;TABLE 
/*Row Dimension*/
Name/**'N' = ' ' */

ALL*{style=[
font_weight=bold 
just=center 
background = cxE5B82E 
foreground=black 
BORDERCOLOR=cxE5B82E  
Font=("Trebuchet MS",9pt)]}
,&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 04 May 2023 12:56:46 GMT</pubDate>
    <dc:creator>Kathryn_SAS</dc:creator>
    <dc:date>2023-05-04T12:56:46Z</dc:date>
    <item>
      <title>How to change the sub header styles in proc tabulate using a custom template?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-change-the-sub-header-styles-in-proc-tabulate-using-a/m-p/873500#M26279</link>
      <description>&lt;P&gt;I am trying to add boarders to the sub headers of the output of proc tabulate. I have created a custom style based off monochrome and I have some custom styling in the proc tabulate itself. The code I have:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length Name $10. Field1 $10. Field2 $10.;
infile datalines delimiter='#';
input Name $ Field1 $ Field2 $ N;
datalines;
Jim#stage1#Sub1#1
Steve#stage2#Sub2#1
Dave#stage2#Sub3#1
Jessica#stage2#Sub3#1
Bob#stage3#Sub3#1
Dan#stage2#Sub1#1
Jim#stage1#Sub1#1
Steve#stage1#Sub3#1
Dave#stage2#Sub2#1
Jessica#stage2#Sub2#1
Bob#stage2#Sub1#1
Dan#stage2#Sub3#1
;
run;



proc template;
  define style my_monospace;
    parent=styles.monospace;
class fonts /
      'docFont' = ("Trebuchet MS",8pt)
      'headingFont' = ("Trebuchet MS",9pt,Bold)
      'headingEmphasisFont' = ("Trebuchet MS",9pt,Bold)
      'FixedFont' = ("Trebuchet MS",8pt)
      'FixedHeadingFont' = ("Trebuchet MS",8pt)
      'FixedStrongFont' = ("Trebuchet MS",8pt)
      'FixedEmphasisFont' = ("Trebuchet MS",8pt)
      'EmphasisFont' = ("Trebuchet MS",8pt)
      'StrongFont' = ("Trebuchet MS",8pt)
      'TitleFont' = ("Trebuchet MS",10pt,Bold)
      'TitleFont2' = ("Trebuchet MS",10pt,Bold)
      'BatchFixedFont' = ("Trebuchet MS",8pt);
    class Header / 
      backgroundcolor=cxEEEEEE;
  end;
  end;
run;

proc template;
   source styles.monospace / expand;
run;


ods excel file="...somedirectory\test.xlsx";


    title1 j=center "Title1" ;
	title2 j=center "Title2" ;  
	title3 j=center "Title3" ;  
 
	ods excel options
	(
	sheet_name="Table" 
	sheet_interval="none" 
    frozen_headers="3" 
    embedded_titles="yes"
	)   
style=my_monospace; 
;
PROC TABULATE
DATA=WORK.have
S=[foreground=black just=c cellwidth=125];
	VAR N;
	CLASS Field1 /	ORDER=UNFORMATTED MISSING;
	CLASS Field2 / 	ORDER=UNFORMATTED MISSING;
	CLASS Name /	ORDER=UNFORMATTED MISSING;
	TABLE 
/*Row Dimension*/
Name *'N'=' '  
ALL*{style=[font_weight=bold just=center background = cxE5B82E ]}
,
/* Column Dimension */
Field1*Field2 =' ' 
ALL*{style=[font_weight=bold just=center background = cxE5B82E ]}	
;	
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The output it generates:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASAlex101_0-1683067921117.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83510iB09CD6EB8852C353/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASAlex101_0-1683067921117.png" alt="SASAlex101_0-1683067921117.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the output I'm trying to achieve:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASAlex101_1-1683067990510.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83511iF2C21184D3DC7490/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASAlex101_1-1683067990510.png" alt="SASAlex101_1-1683067990510.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm lost in the styles part - there's so many and I'm not sure what to change to get what I want. Any help with achieving the output I want and how to navigate and understand styles would be helpful.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 22:55:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-change-the-sub-header-styles-in-proc-tabulate-using-a/m-p/873500#M26279</guid>
      <dc:creator>SASAlex101</dc:creator>
      <dc:date>2023-05-02T22:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the sub header styles in proc tabulate using a custom template?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-change-the-sub-header-styles-in-proc-tabulate-using-a/m-p/873546#M26280</link>
      <description>&lt;P&gt;It helps to provide a narrative of what you want as well.&lt;/P&gt;
&lt;P&gt;The CLASSLEV statement is where you set most overrides for style appearance of column or row header variables.&lt;/P&gt;
&lt;P&gt;This gets pretty close to what you are requesting for appearance.&lt;/P&gt;
&lt;P&gt;Note that you can address border combined with top, bottom, right or left with color and width (this is line width: borderbottomwidth=1mm for example to set 1mm width lines). I am not sure if we are getting an interaction with your custom style or not that wasn't coloring the border with the box area. So added a style override for the box area right border&lt;/P&gt;
&lt;PRE&gt;PROC TABULATE 
DATA=WORK.have
S=[foreground=black just=c cellwidth=125];
	VAR N;
	CLASS Field1 /	ORDER=UNFORMATTED MISSING ;
	CLASS Field2 / 	ORDER=UNFORMATTED MISSING ;
	CLASS Name /	ORDER=UNFORMATTED MISSING;
   classlev field1 /style={borderbottomcolor=red borderrightcolor=red borderleftcolor=red};
   classlev field2 /style={bordertopcolor=red borderrightcolor=red borderleftcolor=red};
   TABLE 
      /*Row Dimension*/
      Name *'N'=' '  
      ALL*{style=[font_weight=bold just=center background = cxE5B82E ]}
      ,
      /* Column Dimension */
      Field1*Field2 =' ' 
      ALL*{style=[font_weight=bold just=center background = cxE5B82E ]}	
      /box={style=[borderrightcolor=red]}
   ;	
RUN;
&lt;/PRE&gt;
&lt;P&gt;You could change the text color and font as well with classlev. If you need more control based on the value of the cell you could use one or more formats that use the value of the cell as the start value and the value of the property as the "label" of the format and then use the style element referencing that format such as style=[textcolor=row1colorformat.]&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 07:42:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-change-the-sub-header-styles-in-proc-tabulate-using-a/m-p/873546#M26280</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-05-03T07:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the sub header styles in proc tabulate using a custom template?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-change-the-sub-header-styles-in-proc-tabulate-using-a/m-p/873642#M26281</link>
      <description>&lt;P&gt;Thanks! looks like the custom style is blocking the CLASSLEV style elements. So if I don't use the custom style, I'll have to code all the style elements manually in proc tabulate. This is a workaround I suppose. It would have been nice to have the custom style template work for me though.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 14:04:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-change-the-sub-header-styles-in-proc-tabulate-using-a/m-p/873642#M26281</guid>
      <dc:creator>SASAlex101</dc:creator>
      <dc:date>2023-05-03T14:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the sub header styles in proc tabulate using a custom template?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-change-the-sub-header-styles-in-proc-tabulate-using-a/m-p/873648#M26282</link>
      <description>&lt;P&gt;I'm very close to the custom style I'm going for just can't hit that one cell with the style!~&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
PROC TABULATE
DATA=WORK.have

S=[foreground=black just=c cellwidth=125 
Font = ("Trebuchet MS",8pt)
foreground=black
BORDERCOLOR=white  
]
;
	VAR N /	style={
&amp;amp;standardcellformat.
};
keyword all / style=[&amp;amp;standardcellformat. vjust=center cellwidth=125];
keyword N / style=[&amp;amp;standardcellformat. just=center cellwidth=125];

	CLASS Field1 /	style={
borderbottomcolor=cxD3D3D3 
&amp;amp;standardcellformat.
} ORDER=UNFORMATTED MISSING ;

CLASS Field2 / 	style={
bordertopcolor=cxD3D3D3 
&amp;amp;standardcellformat.
} ORDER=UNFORMATTED MISSING ;

CLASS Name /style={
&amp;amp;standardcellformat.
}	ORDER=UNFORMATTED MISSING;

classlev Field1 /
style={
borderbottomcolor=red 
borderrightcolor=red 
borderleftcolor=red
&amp;amp;standardcellformat.
};
classlev Field2 /
style={
borderrightcolor=red 
borderleftcolor=red
&amp;amp;standardcellformat.
};

classlev Name /
style={
bordercolor=lightgrey
&amp;amp;standardcellformat.
};

TABLE 
/*Row Dimension*/
Name*'N' = ' ' 

ALL*{style=[
font_weight=bold 
just=center 
background = cxE5B82E 
foreground=black 
BORDERCOLOR=cxE5B82E  
Font=("Trebuchet MS",9pt)]}
,

/* Column Dimension */
Field1 * Field2 =' ' 
ALL*{style=[
font_weight=bold 
just=center 
background = cxE5B82E 
foreground=black 
BORDERCOLOR=cxE5B82E  
Font=("Trebuchet MS",9pt)]
}
	
/ box={style=[background = lightgrey borderrightcolor=red]};

;	
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASAlex101_0-1683132879596.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83561iF3B0AEEDFDADE571/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASAlex101_0-1683132879596.png" alt="SASAlex101_0-1683132879596.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 16:54:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-change-the-sub-header-styles-in-proc-tabulate-using-a/m-p/873648#M26282</guid>
      <dc:creator>SASAlex101</dc:creator>
      <dc:date>2023-05-03T16:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the sub header styles in proc tabulate using a custom template?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-change-the-sub-header-styles-in-proc-tabulate-using-a/m-p/873856#M26285</link>
      <description>&lt;P&gt;That is coming from the part of the Table statement I have commented out below. I do not think you need that.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;TABLE 
/*Row Dimension*/
Name/**'N' = ' ' */

ALL*{style=[
font_weight=bold 
just=center 
background = cxE5B82E 
foreground=black 
BORDERCOLOR=cxE5B82E  
Font=("Trebuchet MS",9pt)]}
,&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 May 2023 12:56:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-change-the-sub-header-styles-in-proc-tabulate-using-a/m-p/873856#M26285</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2023-05-04T12:56:46Z</dc:date>
    </item>
  </channel>
</rss>

