<?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: Is there a way to tell Excel (via proc template) to repeat headers?? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-tell-Excel-via-proc-template-to-repeat-headers/m-p/170757#M12289</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much for this!&amp;nbsp; It worked, and specifying the file as xml, rather than xls, meant that the excel file opened right up rather than me having to tell excel to open it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Apr 2014 17:01:04 GMT</pubDate>
    <dc:creator>ljaeger</dc:creator>
    <dc:date>2014-04-08T17:01:04Z</dc:date>
    <item>
      <title>Is there a way to tell Excel (via proc template) to repeat headers??</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-tell-Excel-via-proc-template-to-repeat-headers/m-p/170754#M12286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems like you ought to be able to add code like PUT "x:&amp;lt;RepeatRowHeader&amp;gt;A3:A5&amp;lt;/RepeatRowHeaders&amp;gt;"&amp;nbsp; into a template definition like the one below.&lt;/P&gt;&lt;P&gt;I asked SAS support this question and was told "No, you can't do it," but no suggestions of other things I might try to get repeating headers when passing&lt;/P&gt;&lt;P&gt;data to Excel via Proc Report.&amp;nbsp; Thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC TEMPLATE;&lt;/P&gt;&lt;P&gt;DEFINE tagset tagsets.bhp;&lt;/P&gt;&lt;P&gt;parent=tagsets.MSOffice2K_x;&lt;/P&gt;&lt;P&gt;DEFINE event initialize;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set $orientation tagset_alias;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trigger set_just_lookup;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trigger set_nls_num;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;DEFINE event doc;&lt;/P&gt;&lt;P&gt;START: PUT '&amp;lt;html xmlns:x="urn:schemas-microsoft-com:office:excel"&amp;gt;' NL;&lt;/P&gt;&lt;P&gt;FINISH: PUT "&amp;lt;/html&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;DEFINE event doc_head;&lt;/P&gt;&lt;P&gt;START:&lt;/P&gt;&lt;P&gt;PUT "&amp;lt;head&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;PUT "&amp;lt;style&amp;gt; @page {mso-page-orientation:landscape} &amp;lt;/style&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;PUT VALUE NL;&lt;/P&gt;&lt;P&gt;FINISH:&lt;/P&gt;&lt;P&gt;do / if cmp($orientation,'landscape');&lt;/P&gt;&lt;P&gt;PUT "&amp;lt;!--[if gte mso 9]&amp;gt;&amp;lt;xml&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;PUT "&amp;lt;x:ExcelWorkbook&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;PUT " &amp;lt;x:ExcelWorksheets&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;PUT " &amp;lt;x:ExcelWorksheet&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;PUT " &amp;lt;x:Name&amp;gt;Utilization&amp;lt;/x:Name&amp;gt;" NL;&amp;nbsp; *******change;&lt;/P&gt;&lt;P&gt;PUT " &amp;lt;x:WorksheetOptions&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;put " &amp;lt;x:DisplayPageBreak/&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;put " &amp;lt;x:DisplayZeros/&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;PUT " &amp;lt;x:Print&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;PUT " &amp;lt;x:ValidPrinterInfo/&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;put " &amp;lt;x:Scale&amp;gt;70&amp;lt;/x:Scale&amp;gt;";&lt;/P&gt;&lt;P&gt;PUT " &amp;lt;/x:Print&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;PUT " &amp;lt;/x:WorksheetOptions&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;PUT " &amp;lt;/x:ExcelWorksheet&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;PUT "&amp;lt;/x:ExcelWorkbook&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;PUT "&amp;lt;/xml&amp;gt;&amp;lt;![endif]--&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;done;&lt;/P&gt;&lt;P&gt;PUT "&amp;lt;/head&amp;gt;" NL;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;RUN; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods listing close;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods Tagsets.minimal file='c:\users\ljaeger\saspgm\bhp\reports\hr_all_access.xls' alias='landscape';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 16:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-tell-Excel-via-proc-template-to-repeat-headers/m-p/170754#M12286</guid>
      <dc:creator>ljaeger</dc:creator>
      <dc:date>2014-04-07T16:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to tell Excel (via proc template) to repeat headers??</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-tell-Excel-via-proc-template-to-repeat-headers/m-p/170755#M12287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have to use this particular tagset, MSOFFICE2K_x?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can use Tagset.excelxp you can use the row_repeat option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 16:32:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-tell-Excel-via-proc-template-to-repeat-headers/m-p/170755#M12287</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-04-07T16:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to tell Excel (via proc template) to repeat headers??</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-tell-Excel-via-proc-template-to-repeat-headers/m-p/170756#M12288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; TAGSETS.MSOFFICE2K_X is primarily an HTML tagset with some embedded XML that conforms to a specification that Microsoft used between Office 2000 and the introduction of Spreadsheet Markup Language in Office 2003. If Tech Support told you that changing the tagset template would not get you what you want, then the reason has to be that the Microsoft spec for the "hybrid" HTML/XML does not support what you want to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; However, Reeza is correct that TAGSETS.EXCELXP has quite a few more suboptions than TAGSETS.MSOFFICE2K_X, including an option to repeat row headers. For example, if you run the code below, you should get the results as shown in the screen shot, which show the header rows repeated on page 6 of the output (in landscape mode).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods tagsets.excelxp file='c:\temp\land_repeat.xml' style=minimal&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; options(row_repeat='header' orientation='landscape' doc='Help'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; center_horizontal='yes' center_vertical='no');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;proc report data=sashelp.cars nowd&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;&amp;nbsp; style(header)={font_weight=bold font_style=italic};&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;column make model type mpg_highway mpg_city;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;define model/ style(column)={cellwidth=2in};&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;define mpg_highway / style(column)={cellwidth=1.5in};&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;define mpg_city / style(column)={cellwidth=1.5in};&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG&gt;ods tagsets.excelxp close;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11731iCAE83F726474FEBF/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="output_example_xp.png" title="output_example_xp.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 00:02:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-tell-Excel-via-proc-template-to-repeat-headers/m-p/170756#M12288</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-04-08T00:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to tell Excel (via proc template) to repeat headers??</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-tell-Excel-via-proc-template-to-repeat-headers/m-p/170757#M12289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much for this!&amp;nbsp; It worked, and specifying the file as xml, rather than xls, meant that the excel file opened right up rather than me having to tell excel to open it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 17:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Is-there-a-way-to-tell-Excel-via-proc-template-to-repeat-headers/m-p/170757#M12289</guid>
      <dc:creator>ljaeger</dc:creator>
      <dc:date>2014-04-08T17:01:04Z</dc:date>
    </item>
  </channel>
</rss>

