<?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 Proc Report to Excel - Header background issue in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-to-Excel-Header-background-issue/m-p/526160#M22156</link>
    <description>&lt;P&gt;I have three issues with a report that I am generating.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) I have some 'spanned' columns with heading text that I need highlighted, but when I use what I have been able to find on the web, I can only highlight the text, and not the cell. (look for the following code in the full text code below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;("^S={backgroundcolor=#DDEBF7}2017-18 Actual DOE School Grade"&lt;BR /&gt;doe_ela doe_ela_gain doe_ela_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_mth doe_mth_gain doe_mth_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_sci doe_scs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_accel_ms doe_grad_rate doe_accel_hs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_points doe_components doe_per_points doe_grade)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.) the highlighting, such as it is, does not translate into the excel file itself. It will highlight the text in the "Results - SAS Report" , but not on the produced excel file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3.) I have the top two rows "frozen", but when I open the excel file and attempt to print the file the top most row disappears for pp 2-4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I will attach some pictures to show the difference in (1) and (2) on report and excel file.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the full code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%global school_pk;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;%global prediction_type;&lt;BR /&gt;%let school_pk=9999;&lt;BR /&gt;%let prediction_type=Q1;&lt;BR /&gt;&lt;BR /&gt;data _null_;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;t=today();&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;today=put(t,yymmddn8.);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;call symput('today',today);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;call symput('school_number',put(&amp;amp;school_pk,z4.));&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%let school_number=&amp;amp;school_number;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;%put &amp;amp;school_number;&lt;/P&gt;&lt;P&gt;%let school_year=&amp;amp;FocusSchoolYear;&lt;BR /&gt;%put &amp;amp;school_year;&lt;/P&gt;&lt;P&gt;data details_PY(keep=doe_year school_number school_name school_number_name&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_ela doe_ela_gain doe_ela_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_mth doe_mth_gain doe_mth_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_sci doe_scs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_accel_ms doe_grad_rate doe_accel_hs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_points doe_components doe_per_points doe_grade doe_grade_seq);&lt;BR /&gt;set SASdev.DOE_School_Grades;&lt;BR /&gt;where district_number='16'&lt;BR /&gt;and school_year=&amp;amp;FocusSchoolYear-1;&lt;BR /&gt;school_number_name=strip(substr(strip(school_number)||' '||propcase(strip(school_name)),1,43));&lt;BR /&gt;doe_ela=ela;&lt;BR /&gt;doe_ela_gain=ela_gains;&lt;BR /&gt;doe_ela_bq=ela_gains_bq;&lt;BR /&gt;doe_mth=math;&lt;BR /&gt;doe_mth_gain=math_gains;&lt;BR /&gt;doe_mth_bq=math_gains_bq;&lt;BR /&gt;doe_sci=science;&lt;BR /&gt;doe_scs=social_studies;&lt;BR /&gt;doe_accel_ms=ms_acceleration;&lt;BR /&gt;doe_grad_rate=grad_rate_PY;&lt;BR /&gt;doe_accel_hs=college_accel;&lt;BR /&gt;doe_points=total_points;&lt;BR /&gt;doe_components=total_components;&lt;BR /&gt;doe_per_points=percent_points;&lt;BR /&gt;doe_grade=school_grade;&lt;/P&gt;&lt;P&gt;if doe_grade='A' then doe_grade_seq=5; else&lt;BR /&gt;if doe_grade='B' then doe_grade_seq=4; else&lt;BR /&gt;if doe_grade='C' then doe_grade_seq=3; else&lt;BR /&gt;if doe_grade='D' then doe_grade_seq=2; else doe_grade_seq=1;&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table details_PY as&lt;BR /&gt;select distinct&lt;BR /&gt;l.regional_sup_name as region_sup&lt;BR /&gt;, l.executive_director_name as xo&lt;BR /&gt;, l.board_member_name as board_member&lt;BR /&gt;, d.*&lt;BR /&gt;, case l.regional_sup_name&lt;BR /&gt;when 'Green, W.' then 1&lt;BR /&gt;when 'Cagle, S.' then 2&lt;BR /&gt;when 'Henry, M.' then 3&lt;BR /&gt;when 'Wright, C.' then 4&lt;BR /&gt;when 'Charter' then 6&lt;BR /&gt;else 99&lt;BR /&gt;end as sort&lt;BR /&gt;from&lt;BR /&gt;details_PY d&lt;BR /&gt;inner join whse.school_dim l on l.school_number=d.school_number and l.current_ind=1&lt;BR /&gt;order by&lt;BR /&gt;sort,2,3,school_number&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data details_CY(keep=doe_year school_number school_name school_number_name prediction_type&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_ela_achv pred_ela_gain pred_ela_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_mth_achv pred_mth_gain pred_mth_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_sci_achv&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_scs_achv&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_accel_ms pred_grad_rate pred_accel_hs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;points components per_points grade grade_seq);&lt;BR /&gt;format prediction_type $char7.;&lt;BR /&gt;set LPM.School_Grade_Simulator;&lt;BR /&gt;where prediction_type="&amp;amp;prediction_type"&lt;BR /&gt;and ela_pred_prof_num ne .;&lt;BR /&gt;doe_year='2018-19';&lt;BR /&gt;school_number_name=strip(substr(strip(school_number)||' '||propcase(strip(school_name)),1,43));&lt;/P&gt;&lt;P&gt;pred_ela_achv = max(round((ela_pred_prof_num/ela_pred_prof_den)*100,1),0);&lt;BR /&gt;pred_ela_gain = max(round((ela_pred_gain_num/ela_pred_gain_den)*100,1),0);&lt;BR /&gt;pred_ela_bq = max(round((ela_pred_gain_bq_num/ela_pred_gain_bq_den)*100,1),0);&lt;BR /&gt;pred_mth_achv = max(round((mth_pred_prof_num/mth_pred_prof_den)*100,1),0);&lt;BR /&gt;pred_mth_gain = max(round((mth_pred_gain_num/mth_pred_gain_den)*100,1),0);&lt;BR /&gt;pred_mth_bq = max(round((mth_pred_gain_bq_num/mth_pred_gain_bq_den)*100,1),0);&lt;BR /&gt;pred_sci_achv = max(round((sci_pred_prof_num/sci_pred_prof_den)*100,1),0);&lt;BR /&gt;pred_scs_achv = max(round((scs_pred_prof_num/scs_pred_prof_den)*100,1),0);&lt;BR /&gt;pred_accel_ms = max(round(pred_ms_accel*100,1),0);&lt;BR /&gt;pred_grad_rate= max(round(pred_grad_rate*100,1),0);&lt;BR /&gt;pred_accel_hs = max(round(pred_hs_accel*100,1),0);&lt;/P&gt;&lt;P&gt;points=max(pred_ela_achv,0)&lt;BR /&gt;+ max(pred_ela_gain,0)&lt;BR /&gt;+ max(pred_ela_bq,0)&lt;BR /&gt;+ max(pred_mth_achv,0)&lt;BR /&gt;+ max(pred_mth_gain,0)&lt;BR /&gt;+ max(pred_mth_bq,0)&lt;BR /&gt;+ max(pred_sci_achv,0)&lt;BR /&gt;+ max(pred_scs_achv,0)&lt;BR /&gt;+ max(pred_accel_ms,0)&lt;BR /&gt;+ max(pred_grad_rate,0)&lt;BR /&gt;+ max(pred_accel_hs,0);&lt;/P&gt;&lt;P&gt;if max(ela_pred_prof_num,0) &amp;gt;1 then c01=1; else c01=0;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;if max(ela_pred_gain_num,0) &amp;gt;1 then c02=1; else c02=0;&lt;BR /&gt;if max(ela_pred_gain_bq_num,0)&amp;gt;1 then c03=1; else c03=0;&lt;BR /&gt;if max(mth_pred_prof_num,0) &amp;gt;1 then c04=1; else c04=0;&lt;BR /&gt;if max(mth_pred_gain_num,0) &amp;gt;1 then c05=1; else c05=0;&lt;BR /&gt;if max(mth_pred_gain_bq_num,0)&amp;gt;1 then c06=1; else c06=0;&lt;BR /&gt;if max(sci_pred_prof_num,0) &amp;gt;1 then c07=1; else c07=0;&lt;BR /&gt;if max(scs_pred_prof_num,0) &amp;gt;1 then c08=1; else c08=0;&lt;BR /&gt;if max(pred_ms_accel,0) &amp;gt;.1 then c09=1; else c09=0;&lt;BR /&gt;if max(pred_grad_rate,0) &amp;gt;.1 then c10=1; else c10=0;&lt;BR /&gt;if max(pred_hs_accel,0) &amp;gt;.1 then c11=1; else c11=0;&lt;/P&gt;&lt;P&gt;components=c01+c02+c03+c04+c05+c06+c07+c08+c09+c10+c11;&lt;/P&gt;&lt;P&gt;per_points=round(points/components,1);&lt;/P&gt;&lt;P&gt;if per_points ge 62 then grade='A'; else&lt;BR /&gt;if per_points ge 54 then grade='B'; else&lt;BR /&gt;if per_points ge 41 then grade='C'; else&lt;BR /&gt;if per_points ge 32 then grade='D'; else grade='F';&lt;/P&gt;&lt;P&gt;if grade='A' then grade_seq=5; else&lt;BR /&gt;if grade='B' then grade_seq=4; else&lt;BR /&gt;if grade='C' then grade_seq=3; else&lt;BR /&gt;if grade='D' then grade_seq=2; else grade_seq=1;&lt;/P&gt;&lt;P&gt;if prediction_type='BY' then prediction_seq=1; else&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;if prediction_type='Q1' then prediction_seq=2; else&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;if prediction_type='MY' then prediction_seq=3; else&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;if preciction_type='Q3' then prediction_seq=4; else seq=5;&lt;/P&gt;&lt;P&gt;run;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table details_CY as&lt;BR /&gt;select distinct&lt;BR /&gt;l.regional_sup_name as region_sup&lt;BR /&gt;, l.executive_director_name as xo&lt;BR /&gt;, l.board_member_name as board_member&lt;BR /&gt;, d.*&lt;BR /&gt;, case l.regional_sup_name&lt;BR /&gt;when 'Green, W.' then 1&lt;BR /&gt;when 'Cagle, S.' then 2&lt;BR /&gt;when 'Henry, M.' then 3&lt;BR /&gt;when 'Wright, C.' then 4&lt;BR /&gt;when 'Charter' then 6&lt;BR /&gt;else 9&lt;BR /&gt;end as sort&lt;BR /&gt;from&lt;BR /&gt;details_CY d&lt;BR /&gt;inner join whse.school_dim l on l.school_number=d.school_number and l.current_ind=1&lt;BR /&gt;order by&lt;BR /&gt;sort,2,3,school_number&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;data details;&lt;BR /&gt;format prediction_type $char7.;&lt;BR /&gt;merge details_CY&lt;BR /&gt;details_PY;&lt;BR /&gt;by sort xo board_member school_number;&lt;BR /&gt;if grade='F' then grade_bkgd= 0; else&lt;BR /&gt;if grade_seq &amp;gt; doe_grade_seq then grade_bkgd= 1; else&lt;BR /&gt;if grade_seq &amp;lt; doe_grade_seq then grade_bkgd=-1; else&lt;BR /&gt;grade_bkgd= 0;&lt;BR /&gt;spacer1=' ';&lt;BR /&gt;spacer2=' ';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ods escapechar='^';&lt;BR /&gt;ods tagsets.excelxp&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;file="\\t002pmid03\sasdata\School Grades Simulator\All Components\Reports\Superintendent_SGP_Q1.xml"&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;options(autofit_height='yes'&lt;BR /&gt;frozen_headers='2'&lt;BR /&gt;gridlines='yes'&lt;BR /&gt;orientation='landscape'&lt;BR /&gt;pages_fitwidth='1'&lt;BR /&gt;pages_fitheight='4'&lt;BR /&gt;row_repeat='2'&lt;BR /&gt;sheet_name='School Grade Simulator-MY'&lt;BR /&gt;/*wraptext='no'*/);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;options missing=' ' nomprint nomlogic;&lt;/P&gt;&lt;P&gt;proc report data=details missing nowd split='~' spanrows&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;style(column)={font_face=Calibri font_size=10pt background=white borderwidth=1px}&lt;BR /&gt;style(header)={font_face=Calibri font_size=10pt background=white borderwidth=1px just=c font_weight=bold};&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;columns ( sort&lt;BR /&gt;(region_sup xo board_member school_number_name)&lt;/P&gt;&lt;P&gt;("^S={backgroundcolor=#DDEBF7}2017-18 Actual DOE School Grade"&lt;BR /&gt;doe_ela doe_ela_gain doe_ela_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_mth doe_mth_gain doe_mth_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_sci doe_scs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_accel_ms doe_grad_rate doe_accel_hs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_points doe_components doe_per_points doe_grade)&lt;BR /&gt;spacer1&lt;BR /&gt;('2018-19 Mid-Year Simulated School Grade'&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_ela_achv pred_ela_gain pred_ela_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_mth_achv pred_mth_gain pred_mth_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_sci_achv pred_scs_achv&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_accel_ms pred_grad_rate pred_accel_hs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;points components per_points grade grade_bkgd)&lt;BR /&gt;sort&lt;BR /&gt;);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define sort / order noprint;&lt;BR /&gt;define region_sup / group style(column)={width=3.0cm just=c vjust=m} 'Regional~Superintendent';&lt;BR /&gt;define xo / group style(column)={width=3.5cm just=c vjust=m} 'Executive~Director';&lt;BR /&gt;define board_member / group style(column)={width=2.8cm just=c vjust=m} 'Board~Member';&lt;BR /&gt;define school_number_name/ group style(column)={width=7.6cm just=l} 'School Number/Name';&lt;/P&gt;&lt;P&gt;define doe_ela / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'ELA Achievement';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_ela_gain / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'ELA Gains';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_ela_bq / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'ELA BQ Gains';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_mth / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Math Achievement';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_mth_gain / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Math Gains';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_mth_bq / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Math BQ Gains';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_sci / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Science Achievement';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_scs / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Social Studies Achievement';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_accel_ms / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'MS Acceleration';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_grad_rate / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Graduation Rate 1617';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_accel_hs / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'College &amp;amp; Career~Acceleration 1617';&lt;BR /&gt;define doe_points / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Total Points Earned';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_components / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Total Components';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_per_points / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'% of Total Possible Points';&lt;BR /&gt;define doe_grade / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'School Grade';&lt;/P&gt;&lt;P&gt;define spacer1 / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'';&lt;/P&gt;&lt;P&gt;define pred_ela_achv / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'ELA Achievement';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define pred_ela_gain / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'ELA Gains';&lt;BR /&gt;define pred_ela_bq / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'ELA BQ Gains';&lt;BR /&gt;define pred_mth_achv / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Math Achievement';&lt;BR /&gt;define pred_mth_gain / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Math Gains';&lt;BR /&gt;define pred_mth_bq / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Math BQ Gains';&lt;BR /&gt;define pred_sci_achv / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Science Achievement';&lt;BR /&gt;define pred_scs_achv / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Social Studies Achievement';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define pred_accel_ms / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'MS Acceleration';&lt;BR /&gt;define pred_grad_rate / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Graduation Rate 1718';&lt;BR /&gt;define pred_accel_hs / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Projected College &amp;amp; Career~ Acceleration 1718';&lt;BR /&gt;define points / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Total Points Earned';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define components / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Total Components';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define per_points / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'% of Total Possible Points';&lt;BR /&gt;define grade / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'School Grade';&lt;BR /&gt;define grade_bkgd / noprint;&lt;/P&gt;&lt;P&gt;compute grade / char;&lt;BR /&gt;if grade='F' then do;&lt;BR /&gt;call define ("grade","style","style={background=red}");&lt;BR /&gt;end;&lt;BR /&gt;endcomp;&lt;/P&gt;&lt;P&gt;compute grade_bkgd;&lt;BR /&gt;if grade_bkgd.sum = 1 then do;&lt;BR /&gt;call define ("grade","style","style=[background=#A9D08E]");&lt;BR /&gt;end;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;if grade_bkgd.sum = -1 then do;&lt;BR /&gt;call define ("grade","style","style={background=rose}");&lt;BR /&gt;end;&lt;BR /&gt;endcomp;&lt;/P&gt;&lt;P&gt;compute board_member / char;&lt;BR /&gt;if board_member ~= '' then do;&lt;BR /&gt;call define (_row_,"style","style={bordertopwidth=2px}");&lt;BR /&gt;end;&lt;BR /&gt;endcomp;&lt;BR /&gt;compute xo / char;&lt;BR /&gt;if xo ~= '' then do;&lt;BR /&gt;call define (_row_,"style","style={bordertopwidth=3px}");&lt;BR /&gt;end;&lt;BR /&gt;endcomp;&lt;BR /&gt;compute region_sup / char;&lt;BR /&gt;if region_sup ~= '' then do;&lt;BR /&gt;call define (_row_,"style","style={bordertopwidth=4px}");&lt;BR /&gt;end;&lt;BR /&gt;endcomp;&lt;/P&gt;&lt;P&gt;run;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ods _all_ close;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jan 2019 19:10:33 GMT</pubDate>
    <dc:creator>cuevasj</dc:creator>
    <dc:date>2019-01-10T19:10:33Z</dc:date>
    <item>
      <title>Proc Report to Excel - Header background issue</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-to-Excel-Header-background-issue/m-p/526160#M22156</link>
      <description>&lt;P&gt;I have three issues with a report that I am generating.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) I have some 'spanned' columns with heading text that I need highlighted, but when I use what I have been able to find on the web, I can only highlight the text, and not the cell. (look for the following code in the full text code below:&amp;nbsp;&lt;/P&gt;&lt;P&gt;("^S={backgroundcolor=#DDEBF7}2017-18 Actual DOE School Grade"&lt;BR /&gt;doe_ela doe_ela_gain doe_ela_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_mth doe_mth_gain doe_mth_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_sci doe_scs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_accel_ms doe_grad_rate doe_accel_hs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_points doe_components doe_per_points doe_grade)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.) the highlighting, such as it is, does not translate into the excel file itself. It will highlight the text in the "Results - SAS Report" , but not on the produced excel file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3.) I have the top two rows "frozen", but when I open the excel file and attempt to print the file the top most row disappears for pp 2-4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I will attach some pictures to show the difference in (1) and (2) on report and excel file.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the full code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%global school_pk;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;%global prediction_type;&lt;BR /&gt;%let school_pk=9999;&lt;BR /&gt;%let prediction_type=Q1;&lt;BR /&gt;&lt;BR /&gt;data _null_;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;t=today();&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;today=put(t,yymmddn8.);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;call symput('today',today);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;call symput('school_number',put(&amp;amp;school_pk,z4.));&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;%let school_number=&amp;amp;school_number;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;%put &amp;amp;school_number;&lt;/P&gt;&lt;P&gt;%let school_year=&amp;amp;FocusSchoolYear;&lt;BR /&gt;%put &amp;amp;school_year;&lt;/P&gt;&lt;P&gt;data details_PY(keep=doe_year school_number school_name school_number_name&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_ela doe_ela_gain doe_ela_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_mth doe_mth_gain doe_mth_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_sci doe_scs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_accel_ms doe_grad_rate doe_accel_hs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_points doe_components doe_per_points doe_grade doe_grade_seq);&lt;BR /&gt;set SASdev.DOE_School_Grades;&lt;BR /&gt;where district_number='16'&lt;BR /&gt;and school_year=&amp;amp;FocusSchoolYear-1;&lt;BR /&gt;school_number_name=strip(substr(strip(school_number)||' '||propcase(strip(school_name)),1,43));&lt;BR /&gt;doe_ela=ela;&lt;BR /&gt;doe_ela_gain=ela_gains;&lt;BR /&gt;doe_ela_bq=ela_gains_bq;&lt;BR /&gt;doe_mth=math;&lt;BR /&gt;doe_mth_gain=math_gains;&lt;BR /&gt;doe_mth_bq=math_gains_bq;&lt;BR /&gt;doe_sci=science;&lt;BR /&gt;doe_scs=social_studies;&lt;BR /&gt;doe_accel_ms=ms_acceleration;&lt;BR /&gt;doe_grad_rate=grad_rate_PY;&lt;BR /&gt;doe_accel_hs=college_accel;&lt;BR /&gt;doe_points=total_points;&lt;BR /&gt;doe_components=total_components;&lt;BR /&gt;doe_per_points=percent_points;&lt;BR /&gt;doe_grade=school_grade;&lt;/P&gt;&lt;P&gt;if doe_grade='A' then doe_grade_seq=5; else&lt;BR /&gt;if doe_grade='B' then doe_grade_seq=4; else&lt;BR /&gt;if doe_grade='C' then doe_grade_seq=3; else&lt;BR /&gt;if doe_grade='D' then doe_grade_seq=2; else doe_grade_seq=1;&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table details_PY as&lt;BR /&gt;select distinct&lt;BR /&gt;l.regional_sup_name as region_sup&lt;BR /&gt;, l.executive_director_name as xo&lt;BR /&gt;, l.board_member_name as board_member&lt;BR /&gt;, d.*&lt;BR /&gt;, case l.regional_sup_name&lt;BR /&gt;when 'Green, W.' then 1&lt;BR /&gt;when 'Cagle, S.' then 2&lt;BR /&gt;when 'Henry, M.' then 3&lt;BR /&gt;when 'Wright, C.' then 4&lt;BR /&gt;when 'Charter' then 6&lt;BR /&gt;else 99&lt;BR /&gt;end as sort&lt;BR /&gt;from&lt;BR /&gt;details_PY d&lt;BR /&gt;inner join whse.school_dim l on l.school_number=d.school_number and l.current_ind=1&lt;BR /&gt;order by&lt;BR /&gt;sort,2,3,school_number&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data details_CY(keep=doe_year school_number school_name school_number_name prediction_type&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_ela_achv pred_ela_gain pred_ela_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_mth_achv pred_mth_gain pred_mth_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_sci_achv&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_scs_achv&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_accel_ms pred_grad_rate pred_accel_hs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;points components per_points grade grade_seq);&lt;BR /&gt;format prediction_type $char7.;&lt;BR /&gt;set LPM.School_Grade_Simulator;&lt;BR /&gt;where prediction_type="&amp;amp;prediction_type"&lt;BR /&gt;and ela_pred_prof_num ne .;&lt;BR /&gt;doe_year='2018-19';&lt;BR /&gt;school_number_name=strip(substr(strip(school_number)||' '||propcase(strip(school_name)),1,43));&lt;/P&gt;&lt;P&gt;pred_ela_achv = max(round((ela_pred_prof_num/ela_pred_prof_den)*100,1),0);&lt;BR /&gt;pred_ela_gain = max(round((ela_pred_gain_num/ela_pred_gain_den)*100,1),0);&lt;BR /&gt;pred_ela_bq = max(round((ela_pred_gain_bq_num/ela_pred_gain_bq_den)*100,1),0);&lt;BR /&gt;pred_mth_achv = max(round((mth_pred_prof_num/mth_pred_prof_den)*100,1),0);&lt;BR /&gt;pred_mth_gain = max(round((mth_pred_gain_num/mth_pred_gain_den)*100,1),0);&lt;BR /&gt;pred_mth_bq = max(round((mth_pred_gain_bq_num/mth_pred_gain_bq_den)*100,1),0);&lt;BR /&gt;pred_sci_achv = max(round((sci_pred_prof_num/sci_pred_prof_den)*100,1),0);&lt;BR /&gt;pred_scs_achv = max(round((scs_pred_prof_num/scs_pred_prof_den)*100,1),0);&lt;BR /&gt;pred_accel_ms = max(round(pred_ms_accel*100,1),0);&lt;BR /&gt;pred_grad_rate= max(round(pred_grad_rate*100,1),0);&lt;BR /&gt;pred_accel_hs = max(round(pred_hs_accel*100,1),0);&lt;/P&gt;&lt;P&gt;points=max(pred_ela_achv,0)&lt;BR /&gt;+ max(pred_ela_gain,0)&lt;BR /&gt;+ max(pred_ela_bq,0)&lt;BR /&gt;+ max(pred_mth_achv,0)&lt;BR /&gt;+ max(pred_mth_gain,0)&lt;BR /&gt;+ max(pred_mth_bq,0)&lt;BR /&gt;+ max(pred_sci_achv,0)&lt;BR /&gt;+ max(pred_scs_achv,0)&lt;BR /&gt;+ max(pred_accel_ms,0)&lt;BR /&gt;+ max(pred_grad_rate,0)&lt;BR /&gt;+ max(pred_accel_hs,0);&lt;/P&gt;&lt;P&gt;if max(ela_pred_prof_num,0) &amp;gt;1 then c01=1; else c01=0;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;if max(ela_pred_gain_num,0) &amp;gt;1 then c02=1; else c02=0;&lt;BR /&gt;if max(ela_pred_gain_bq_num,0)&amp;gt;1 then c03=1; else c03=0;&lt;BR /&gt;if max(mth_pred_prof_num,0) &amp;gt;1 then c04=1; else c04=0;&lt;BR /&gt;if max(mth_pred_gain_num,0) &amp;gt;1 then c05=1; else c05=0;&lt;BR /&gt;if max(mth_pred_gain_bq_num,0)&amp;gt;1 then c06=1; else c06=0;&lt;BR /&gt;if max(sci_pred_prof_num,0) &amp;gt;1 then c07=1; else c07=0;&lt;BR /&gt;if max(scs_pred_prof_num,0) &amp;gt;1 then c08=1; else c08=0;&lt;BR /&gt;if max(pred_ms_accel,0) &amp;gt;.1 then c09=1; else c09=0;&lt;BR /&gt;if max(pred_grad_rate,0) &amp;gt;.1 then c10=1; else c10=0;&lt;BR /&gt;if max(pred_hs_accel,0) &amp;gt;.1 then c11=1; else c11=0;&lt;/P&gt;&lt;P&gt;components=c01+c02+c03+c04+c05+c06+c07+c08+c09+c10+c11;&lt;/P&gt;&lt;P&gt;per_points=round(points/components,1);&lt;/P&gt;&lt;P&gt;if per_points ge 62 then grade='A'; else&lt;BR /&gt;if per_points ge 54 then grade='B'; else&lt;BR /&gt;if per_points ge 41 then grade='C'; else&lt;BR /&gt;if per_points ge 32 then grade='D'; else grade='F';&lt;/P&gt;&lt;P&gt;if grade='A' then grade_seq=5; else&lt;BR /&gt;if grade='B' then grade_seq=4; else&lt;BR /&gt;if grade='C' then grade_seq=3; else&lt;BR /&gt;if grade='D' then grade_seq=2; else grade_seq=1;&lt;/P&gt;&lt;P&gt;if prediction_type='BY' then prediction_seq=1; else&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;if prediction_type='Q1' then prediction_seq=2; else&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;if prediction_type='MY' then prediction_seq=3; else&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;if preciction_type='Q3' then prediction_seq=4; else seq=5;&lt;/P&gt;&lt;P&gt;run;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table details_CY as&lt;BR /&gt;select distinct&lt;BR /&gt;l.regional_sup_name as region_sup&lt;BR /&gt;, l.executive_director_name as xo&lt;BR /&gt;, l.board_member_name as board_member&lt;BR /&gt;, d.*&lt;BR /&gt;, case l.regional_sup_name&lt;BR /&gt;when 'Green, W.' then 1&lt;BR /&gt;when 'Cagle, S.' then 2&lt;BR /&gt;when 'Henry, M.' then 3&lt;BR /&gt;when 'Wright, C.' then 4&lt;BR /&gt;when 'Charter' then 6&lt;BR /&gt;else 9&lt;BR /&gt;end as sort&lt;BR /&gt;from&lt;BR /&gt;details_CY d&lt;BR /&gt;inner join whse.school_dim l on l.school_number=d.school_number and l.current_ind=1&lt;BR /&gt;order by&lt;BR /&gt;sort,2,3,school_number&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;data details;&lt;BR /&gt;format prediction_type $char7.;&lt;BR /&gt;merge details_CY&lt;BR /&gt;details_PY;&lt;BR /&gt;by sort xo board_member school_number;&lt;BR /&gt;if grade='F' then grade_bkgd= 0; else&lt;BR /&gt;if grade_seq &amp;gt; doe_grade_seq then grade_bkgd= 1; else&lt;BR /&gt;if grade_seq &amp;lt; doe_grade_seq then grade_bkgd=-1; else&lt;BR /&gt;grade_bkgd= 0;&lt;BR /&gt;spacer1=' ';&lt;BR /&gt;spacer2=' ';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ods escapechar='^';&lt;BR /&gt;ods tagsets.excelxp&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;file="\\t002pmid03\sasdata\School Grades Simulator\All Components\Reports\Superintendent_SGP_Q1.xml"&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;options(autofit_height='yes'&lt;BR /&gt;frozen_headers='2'&lt;BR /&gt;gridlines='yes'&lt;BR /&gt;orientation='landscape'&lt;BR /&gt;pages_fitwidth='1'&lt;BR /&gt;pages_fitheight='4'&lt;BR /&gt;row_repeat='2'&lt;BR /&gt;sheet_name='School Grade Simulator-MY'&lt;BR /&gt;/*wraptext='no'*/);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;options missing=' ' nomprint nomlogic;&lt;/P&gt;&lt;P&gt;proc report data=details missing nowd split='~' spanrows&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;style(column)={font_face=Calibri font_size=10pt background=white borderwidth=1px}&lt;BR /&gt;style(header)={font_face=Calibri font_size=10pt background=white borderwidth=1px just=c font_weight=bold};&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;columns ( sort&lt;BR /&gt;(region_sup xo board_member school_number_name)&lt;/P&gt;&lt;P&gt;("^S={backgroundcolor=#DDEBF7}2017-18 Actual DOE School Grade"&lt;BR /&gt;doe_ela doe_ela_gain doe_ela_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_mth doe_mth_gain doe_mth_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_sci doe_scs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_accel_ms doe_grad_rate doe_accel_hs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;doe_points doe_components doe_per_points doe_grade)&lt;BR /&gt;spacer1&lt;BR /&gt;('2018-19 Mid-Year Simulated School Grade'&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_ela_achv pred_ela_gain pred_ela_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_mth_achv pred_mth_gain pred_mth_bq&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_sci_achv pred_scs_achv&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pred_accel_ms pred_grad_rate pred_accel_hs&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;points components per_points grade grade_bkgd)&lt;BR /&gt;sort&lt;BR /&gt;);&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define sort / order noprint;&lt;BR /&gt;define region_sup / group style(column)={width=3.0cm just=c vjust=m} 'Regional~Superintendent';&lt;BR /&gt;define xo / group style(column)={width=3.5cm just=c vjust=m} 'Executive~Director';&lt;BR /&gt;define board_member / group style(column)={width=2.8cm just=c vjust=m} 'Board~Member';&lt;BR /&gt;define school_number_name/ group style(column)={width=7.6cm just=l} 'School Number/Name';&lt;/P&gt;&lt;P&gt;define doe_ela / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'ELA Achievement';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_ela_gain / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'ELA Gains';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_ela_bq / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'ELA BQ Gains';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_mth / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Math Achievement';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_mth_gain / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Math Gains';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_mth_bq / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Math BQ Gains';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_sci / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Science Achievement';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_scs / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Social Studies Achievement';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_accel_ms / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'MS Acceleration';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_grad_rate / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Graduation Rate 1617';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_accel_hs / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'College &amp;amp; Career~Acceleration 1617';&lt;BR /&gt;define doe_points / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Total Points Earned';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_components / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'Total Components';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define doe_per_points / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'% of Total Possible Points';&lt;BR /&gt;define doe_grade / display style(column)={background=#DDEBF7 width=1.0cm just=c} style(header)={background=#DDEBF7 tagattr='Format:@ rotate:90'}'School Grade';&lt;/P&gt;&lt;P&gt;define spacer1 / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'';&lt;/P&gt;&lt;P&gt;define pred_ela_achv / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'ELA Achievement';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define pred_ela_gain / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'ELA Gains';&lt;BR /&gt;define pred_ela_bq / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'ELA BQ Gains';&lt;BR /&gt;define pred_mth_achv / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Math Achievement';&lt;BR /&gt;define pred_mth_gain / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Math Gains';&lt;BR /&gt;define pred_mth_bq / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Math BQ Gains';&lt;BR /&gt;define pred_sci_achv / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Science Achievement';&lt;BR /&gt;define pred_scs_achv / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Social Studies Achievement';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define pred_accel_ms / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'MS Acceleration';&lt;BR /&gt;define pred_grad_rate / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Graduation Rate 1718';&lt;BR /&gt;define pred_accel_hs / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Projected College &amp;amp; Career~ Acceleration 1718';&lt;BR /&gt;define points / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Total Points Earned';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define components / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'Total Components';&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;define per_points / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'% of Total Possible Points';&lt;BR /&gt;define grade / display style(column)={width=1.0cm just=c} style(header)={tagattr='Format:@ rotate:90'}'School Grade';&lt;BR /&gt;define grade_bkgd / noprint;&lt;/P&gt;&lt;P&gt;compute grade / char;&lt;BR /&gt;if grade='F' then do;&lt;BR /&gt;call define ("grade","style","style={background=red}");&lt;BR /&gt;end;&lt;BR /&gt;endcomp;&lt;/P&gt;&lt;P&gt;compute grade_bkgd;&lt;BR /&gt;if grade_bkgd.sum = 1 then do;&lt;BR /&gt;call define ("grade","style","style=[background=#A9D08E]");&lt;BR /&gt;end;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;if grade_bkgd.sum = -1 then do;&lt;BR /&gt;call define ("grade","style","style={background=rose}");&lt;BR /&gt;end;&lt;BR /&gt;endcomp;&lt;/P&gt;&lt;P&gt;compute board_member / char;&lt;BR /&gt;if board_member ~= '' then do;&lt;BR /&gt;call define (_row_,"style","style={bordertopwidth=2px}");&lt;BR /&gt;end;&lt;BR /&gt;endcomp;&lt;BR /&gt;compute xo / char;&lt;BR /&gt;if xo ~= '' then do;&lt;BR /&gt;call define (_row_,"style","style={bordertopwidth=3px}");&lt;BR /&gt;end;&lt;BR /&gt;endcomp;&lt;BR /&gt;compute region_sup / char;&lt;BR /&gt;if region_sup ~= '' then do;&lt;BR /&gt;call define (_row_,"style","style={bordertopwidth=4px}");&lt;BR /&gt;end;&lt;BR /&gt;endcomp;&lt;/P&gt;&lt;P&gt;run;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ods _all_ close;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 19:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-to-Excel-Header-background-issue/m-p/526160#M22156</guid>
      <dc:creator>cuevasj</dc:creator>
      <dc:date>2019-01-10T19:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report to Excel - Header background issue</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-to-Excel-Header-background-issue/m-p/526186#M22157</link>
      <description>FYI - I've moved the post to the ODS forum.</description>
      <pubDate>Thu, 10 Jan 2019 20:09:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-to-Excel-Header-background-issue/m-p/526186#M22157</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-10T20:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report to Excel - Header background issue</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-to-Excel-Header-background-issue/m-p/526518#M22168</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Using 9.4 M5 and ODS EXCEL or ODS TAGSETS.EXCELXP, the second example of PROC REPORT code works for me and produced this output:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="back_span_headers_report.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26209iCAE81BDFCBFCC488/image-size/large?v=v2&amp;amp;px=999" role="button" title="back_span_headers_report.png" alt="back_span_headers_report.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Sheet 2 in both Excel files. I know it's a bit garishly colored in the background, but the colors who exactly where the change was coded.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html path='c:\temp' file='span_hdr_back.html';
ods excel file='c:\temp\span_hdr_back.xlsx' options(sheet_name='NotWorkExcel');
ods tagsets.excelxp file='c:\temp\span_hdr_xp.xml' style=htmlblue
    options(sheet_name='NotWorkExcel');
ods escapechar='^';

** This top approach will work in ODS HTML, but NOT on sheet 1 in ODS EXCEL;
** or TAGSETS.EXCELXP;
proc report data=sashelp.shoes;
  where region in ('Canada', 'Pacific');
  column ('^{style[background=yellow]Spanning Header}' product) region,(sales returns);
  define product / group;
  define region/across ' ';
run;

ods excel options(sheet_name='YesWorkExcel');
ods tagsets.excelxp options(sheet_name='YesWorkExcel');

** This technique works in 9.4 M5, but might not work in earlier versions 
   of SAS or in all destinations. It does work for ODS HTML.;
** Look at sheet 2 to see it work for  ODS EXCEL or ODS TAGSETS.EXCELXP;
proc format;
  value $hdr 'Spanning Header'='yellow'
             'Product' = 'lightgreen'
             'Total Sales' = 'lightpink'
             'Total Returns' = 'lightblue'
             'Canada' = 'lavender'
             'Pacific' = 'cyan';
run;

proc report data=sashelp.shoes 
  style(header)={background=$hdr.};
  where region in ('Canada', 'Pacific');
  column ('Spanning Header' product) region,(sales returns);
  define product / group;
  define region/across ' ';
run;
 
ods html close;
ods excel close;
ods tagsets.excelxp close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; Just a caveat that this may not work in all destinations or in earlier versions of SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 22:25:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-to-Excel-Header-background-issue/m-p/526518#M22168</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-01-11T22:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report to Excel - Header background issue</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-to-Excel-Header-background-issue/m-p/526969#M22176</link>
      <description>This worked for issues number one and two. Thank You.&lt;BR /&gt;Any suggestions for issue 3? or should I mark this as accepted solution and post new question for number three?</description>
      <pubDate>Mon, 14 Jan 2019 16:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-to-Excel-Header-background-issue/m-p/526969#M22176</guid>
      <dc:creator>cuevasj</dc:creator>
      <dc:date>2019-01-14T16:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Report to Excel - Header background issue</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-to-Excel-Header-background-issue/m-p/527014#M22178</link>
      <description>&lt;P&gt;Hi:&lt;BR /&gt; Honestly, I'd recommend that you work with Tech Support on #3. I don't work with frozen headers in Excel, so I don't have any suggestions for working with frozen headers. Someone else might, but I'd recommend posting a smaller example that shows the issue with SASHELP data, since everybody has access to that data and no one can run your code without making some very complicated test data.&lt;BR /&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2019 18:30:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-Report-to-Excel-Header-background-issue/m-p/527014#M22178</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-01-14T18:30:51Z</dc:date>
    </item>
  </channel>
</rss>

