<?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: ODS HTML to generate Excel in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89538#M9281</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ANdre. That doesnt work. &lt;/P&gt;&lt;P&gt;I dont know how to get teh background as white. I am using the foloowing code:&lt;/P&gt;&lt;P&gt;ODS msoffice2k FILE=&amp;amp;fl. ;&lt;/P&gt;&lt;P&gt;proc print data=inds label noobs style(report)={background=white};&lt;/P&gt;&lt;P&gt;var a/style(data)={htmlstyle="width:'500pt'"} ;&lt;/P&gt;&lt;P&gt;var b -- c/&amp;nbsp; style(data)={htmlstyle="mso-number-format:'\@';"};&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Can nayone help me on this.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Dec 2012 18:27:17 GMT</pubDate>
    <dc:creator>maggi2410</dc:creator>
    <dc:date>2012-12-04T18:27:17Z</dc:date>
    <item>
      <title>ODS HTML to generate Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89534#M9277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am facing one problem while using ODS HTML to generate excel. &lt;/P&gt;&lt;P&gt;This is my code &lt;/P&gt;&lt;P&gt;ODS HTML FILE=&amp;amp;fl. HEADTEXT="&amp;lt;STYLE&amp;gt; .test1 {mso-width-source:userset;width:1000pt} &lt;/P&gt;&lt;P&gt; .test2&amp;nbsp; {MSO-NUMBER-FORMAT:\@}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/STYLE&amp;gt;";&lt;/P&gt;&lt;P&gt;proc print data=import.final label noobs;&lt;/P&gt;&lt;P&gt;title ;&lt;/P&gt;&lt;P&gt;footnote;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var a/ style={htmlclass="test1"};&lt;/P&gt;&lt;P&gt;var b -- z/style={htmlclass="test2"}&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods html close; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now &lt;/P&gt;&lt;P&gt;1) I have to apply character format while reading all the columns from dataset, because I hav values like 0.80, o.90 etc.&lt;/P&gt;&lt;P&gt;2) I have to apply the column width to the column a only, as it has VERY LONG text values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is how can I apply both these properties in ODS HTML. The way I am doing it currently(shown in code above), only one of them works&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 00:50:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89534#M9277</guid>
      <dc:creator>maggi2410</dc:creator>
      <dc:date>2012-12-04T00:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML to generate Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89535#M9278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; HTMLCLASS (in my experience) works best with HTML files that follow the use of CSS Class Selectors, as outlined in the HTML 4.0 spec -- with files that are supposed to be opened by a browser. I've always found Excel to be a bit picky about CLASS selectors -- especially since ODS HTML makes HTML 4.0 compliant tags, which, generally, Excel is not very happy about opening. If you look at a Microsoft STYLE section versus HTML 4.0 style section, you will see a LOT of differences in the way the 2 style sections look.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; That's why I use ODS MSOFFICE2K as the destination -- it is "Microsoft-friendly" flavor of HTML -- it is the flavor of HTML that Microsoft designed when they decided that they didn't like the HTML 4.0 specification. Rather than using CLASS selectors, I find that using a simple HTMLSTYLE attribute to pass in my Microsoft specific formats is what always works best. Microsoft has a special (different) way that it uses CLASS selectors in Microsoft version of HTML -- it is not standard CSS -- which is what HTMLCLASS is designed to produce as a style override. And, HTMLSTYLE is designed to put a style override down in the &amp;lt;TR&amp;gt; or &amp;lt;TD&amp;gt; tag, where Microsoft will (generally) respect the override.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The other thing I note is that generally, PROC PRINT "likes" for you to specify the area in the STYLE override - -such as:&lt;/P&gt;&lt;P&gt;style(header)={...} or style(data)={...} -- that's because some of the formats that you want to specify will or should only be applied to the "data" cells and not the "header" cells in the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I thought 1000 pt was too big, so in my sample program, I used 200pt in order to get all the columns on the same sheet when Excel opened the HTML file. Note that I gave the file a .XLS extension just so I could be lazy and double click from Windows Explorer and launch Excel instead of launching a browser, (if I gave an extension of .HTML). Of course, when you use .XLS as the file extension, you are not creating a true, binary Excel file -- you are just fooling the Windows registry into launching Excel when the file icon is double clicked. You can look at the output file in Notepad to see that it reallly is HTML in the output file created by ODS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The screenshot shows all the code I submitted and the output opened in Excel. Note that all my numeric columns were treated as character and that my NAME column is bigger than the default width. The techniques that I show in this program were outlined in my SAS Global Forum paper in 2011: &lt;A href="http://support.sas.com/resources/papers/proceedings11/266-2011.pdf" title="http://support.sas.com/resources/papers/proceedings11/266-2011.pdf"&gt;http://support.sas.com/resources/papers/proceedings11/266-2011.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11780iEEE5D6473DD3510D/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="use_mso_htmlstyle.png" title="use_mso_htmlstyle.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 05:56:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89535#M9278</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-12-04T05:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML to generate Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89536#M9279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thankyou so much Cynthia. Things seem to work now for me. But now the problem is I am getting the background color as Gray. But I want it to be white. How can I change it?&lt;/P&gt;&lt;P&gt;I guess for Proc report the code is:&lt;/P&gt;&lt;P&gt;style(report)={background=white}&lt;/P&gt;&lt;P&gt;But how and where should I put in it proc print, ie in the type of code , you put it in your screen shot.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 06:49:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89536#M9279</guid>
      <dc:creator>maggi2410</dc:creator>
      <dc:date>2012-12-04T06:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML to generate Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89537#M9280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maggi&lt;/P&gt;&lt;P&gt;proc print data=...&amp;nbsp;&amp;nbsp; style(table)={background=white}&lt;/P&gt;&lt;P&gt;is i think the answer for proc print&lt;/P&gt;&lt;P&gt;Andre&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 11:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89537#M9280</guid>
      <dc:creator>Andre</dc:creator>
      <dc:date>2012-12-04T11:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML to generate Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89538#M9281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ANdre. That doesnt work. &lt;/P&gt;&lt;P&gt;I dont know how to get teh background as white. I am using the foloowing code:&lt;/P&gt;&lt;P&gt;ODS msoffice2k FILE=&amp;amp;fl. ;&lt;/P&gt;&lt;P&gt;proc print data=inds label noobs style(report)={background=white};&lt;/P&gt;&lt;P&gt;var a/style(data)={htmlstyle="width:'500pt'"} ;&lt;/P&gt;&lt;P&gt;var b -- c/&amp;nbsp; style(data)={htmlstyle="mso-number-format:'\@';"};&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Can nayone help me on this.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 18:27:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89538#M9281</guid>
      <dc:creator>maggi2410</dc:creator>
      <dc:date>2012-12-04T18:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML to generate Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89539#M9282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maggi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Did you copy my code? If you used the MSOFFICE2K destination and style=sasweb, you should get a white background under the table. But, the rest of the cells in the sheet -- the "other" cells not bounded by the table will be gray, that is an artifact of Excel and how it opens HTML markup files. If you want the rest of the background, of the "unused" cells to be white, I think you have to change the style template.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Or, switch to using TAGSETS.EXCELXP -- by default, the unused cells will be white . The syntax will be slightly different.&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;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods tagsets.excelxp file='c:\temp\xpclass.xml' style=sasweb&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; options(absolute_column_width='30,10,10,10,10');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc print data=sashelp.class label noobs;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; var name;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; var age -- weight/style(data)={tagattr="FORMAT:@"};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods _all_ close;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 18:38:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89539#M9282</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2012-12-04T18:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: ODS HTML to generate Excel</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89540#M9283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks again Cynthia. Its my bad. Actually I was using sasweb with proc print, instead of using it with proc. &lt;/P&gt;&lt;P&gt;Anywaz, now I used style=styles.minimal. And everything worked for me. &lt;/P&gt;&lt;P&gt;Thanks for ur help. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Dec 2012 19:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-HTML-to-generate-Excel/m-p/89540#M9283</guid>
      <dc:creator>maggi2410</dc:creator>
      <dc:date>2012-12-04T19:15:20Z</dc:date>
    </item>
  </channel>
</rss>

