<?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: cellwidth and ExcelXP in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75082#M8536</link>
    <description>Hi:&lt;BR /&gt;
  The times I have used the Absolute_Column_Width sub-option I have explicitly changed all my columns. For example, if I do this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data calif;&lt;BR /&gt;
  set sashelp.prdsale;&lt;BR /&gt;
  Area_Name= Country;&lt;BR /&gt;
  High_Level_Definition = Region;&lt;BR /&gt;
run;&lt;BR /&gt;
                    &lt;BR /&gt;
ods tagsets.excelxp file='calif2.xml' style=sasweb&lt;BR /&gt;
    options(absolute_column_width="30,10,7,7");&lt;BR /&gt;
                         &lt;BR /&gt;
PROC TABULATE data=calif;&lt;BR /&gt;
  CLASS Area_Name / order=freq;&lt;BR /&gt;
  CLASSLEV Area_Name ;&lt;BR /&gt;
  CLASS High_Level_Definition / order=freq;&lt;BR /&gt;
  CLASSLEV High_Level_Definition ;&lt;BR /&gt;
  Table (Area_Name ALL='Decision Total'*[style=&lt;PARENT&gt;]),&lt;BR /&gt;
        (ALL='Area Total'*[style={background=vpapb}] High_Level_Definition=" ")*(N=' ' *f=comma6.)&lt;BR /&gt;
     / BOX={label='Area by Reasons'} NOCONTINUED indent=3 ;&lt;BR /&gt;
   KEYWORD ALL / style=[background=vpapb];&lt;BR /&gt;
run; &lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
Then for my output, using SASHELP.PRDSALE, I see that the first column is significantly wider than the last 2 columns.&lt;BR /&gt;
 &lt;BR /&gt;
I am not exactly sure how column width works. In Excel, if I look at informatiion about column width settings, Excel says that (from the Excel help):&lt;BR /&gt;
&lt;B&gt;&lt;BR /&gt;
On a worksheet, you can specify a column width of 0 (zero) to 255. This value represents the number of characters that can be displayed in a cell that is formatted with the standard font (standard font: The default text font for worksheets. The standard font determines the default font for the Normal cell style.). The default column width is 8.43 characters. If a column has a width of 0 (zero), the column is hidden.&lt;BR /&gt;
&lt;/B&gt;&lt;BR /&gt;
 &lt;BR /&gt;
Then, on this Microsoft site, there's more information about column width:&lt;BR /&gt;
&lt;A href="http://support.microsoft.com/kb/214123" target="_blank"&gt;http://support.microsoft.com/kb/214123&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
  I don't exactly know how ODS deals with the numbers you send via the Absolute_column_width sub-option -- I surmise (but don't know for sure) that somehow the cell font is taken into account by ODS along with the absolute column width and it is some changed value that is being sent to Excel in XML form.&lt;BR /&gt;
&lt;BR /&gt;
  Personally, I don't stress over what ODS is doing. I take the "control freak" approach: and specify absolute column widths for EVERY column and change the numbers I send to ODS until what I see in Excel is what I want.&lt;BR /&gt;
 &lt;BR /&gt;
  If it is essential for you to understand -exactly- how ODS is dealing with the absolute_column_width sub-option, then your best resource is to contact Tech Support. I only know that when I use the absolute_column_width sub-option with TAGSETS.EXCELXP, I can always get Excel to render the columns showing a width that I am happy with.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;/PARENT&gt;</description>
    <pubDate>Thu, 08 Oct 2009 21:23:33 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2009-10-08T21:23:33Z</dc:date>
    <item>
      <title>cellwidth and ExcelXP</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75075#M8529</link>
      <description>Can anyone explain why the cellwidth style option in this example works for the variable Area_Name, but NOT for High_Level_Definition&lt;BR /&gt;
&lt;BR /&gt;
PROC TABULATE data=calif;&lt;BR /&gt;
CLASS       Area_Name              /  order=freq;&lt;BR /&gt;
CLASSLEV Area_Name              /  style=[cellwidth=230];&lt;BR /&gt;
CLASS       High_Level_Definition /  order=freq;&lt;BR /&gt;
CLASSLEV High_Level_Definition /  style=[cellwidth=100];&lt;BR /&gt;
Table (Area_Name ALL='Decision Total'*[style=&lt;PARENT&gt;]),(ALL='Area Total'*[style={background=vpapb}] High_Level_Definition=" ")*&lt;BR /&gt;
      (N=' '   *f=comma6.)&lt;BR /&gt;
      / BOX={label='Area by Reasons' style=[cellwidth=230]} NOCONTINUED indent=3 ;&lt;BR /&gt;
        KEYWORD ALL / style=[background=vpapb];&lt;BR /&gt;
      run;&lt;/PARENT&gt;</description>
      <pubDate>Thu, 08 Oct 2009 14:28:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75075#M8529</guid>
      <dc:creator>steve_citi</dc:creator>
      <dc:date>2009-10-08T14:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: cellwidth and ExcelXP</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75076#M8530</link>
      <description>Hi:&lt;BR /&gt;
  Excel may not always honor the cellwidths you set inside SAS. That is why TAGSETS.EXCELXP has 2 different sub-options for specifying a cellwidth for Excel to use when it opens and renders the XML in the ExcelXP result file:&lt;BR /&gt;
default_column_width&lt;BR /&gt;
absolute_column_width&lt;BR /&gt;
 &lt;BR /&gt;
If you alter your ODS TAGSETS.EXCELXP invocation to use the Help facility:&lt;BR /&gt;
[pre]&lt;BR /&gt;
  ods tagsets.excelxp file='tabxp.xml' style=sasweb;&lt;BR /&gt;
        options(doc='Help');&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
You will find the list of complete options in the SAS Log. &lt;BR /&gt;
&lt;BR /&gt;
In addition, this paper about creating "printable" spreadsheets with TAGSETS.EXCELXP may be useful.&lt;BR /&gt;
 &lt;A href="http://www.nesug.org/proceedings/nesug08/ap/ap06.pdf" target="_blank"&gt;http://www.nesug.org/proceedings/nesug08/ap/ap06.pdf&lt;/A&gt; (see  page 10 for an example of absolute column width usage)&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 08 Oct 2009 15:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75076#M8530</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-10-08T15:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: cellwidth and ExcelXP</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75077#M8531</link>
      <description>SAS did honor the cellwidth for Area_Name.  Can the other 2 alternatives you mention adjust the width of only a specific variable, or does it adjust all columns in the same way.</description>
      <pubDate>Thu, 08 Oct 2009 16:36:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75077#M8531</guid>
      <dc:creator>steve_citi</dc:creator>
      <dc:date>2009-10-08T16:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: cellwidth and ExcelXP</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75078#M8532</link>
      <description>Hi:&lt;BR /&gt;
  When SAS creates the file, SAS does not "honor" the cellwidth. SAS merely places the instruction into the TAGSETS.EXCELXP file. Then it is Excel which RENDERS the file. So it is EXCEL that is honoring the cellwidth for Area_Name, but not honoring the cellwidth for the other columns -- this happens when the file is RENDERED (by EXCEL) not when the file is CREATED (by SAS).&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 08 Oct 2009 16:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75078#M8532</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-10-08T16:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: cellwidth and ExcelXP</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75079#M8533</link>
      <description>Okay....are we sure SAS is placing the instruction into the code which Excel reads to RENDER the spreadsheet.&lt;BR /&gt;
&lt;BR /&gt;
Someone is dropping the ball on this one.</description>
      <pubDate>Thu, 08 Oct 2009 16:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75079#M8533</guid>
      <dc:creator>steve_citi</dc:creator>
      <dc:date>2009-10-08T16:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: cellwidth and ExcelXP</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75080#M8534</link>
      <description>Hi:&lt;BR /&gt;
  When I run a test (using data from SASHELP.PRDSALE), but using your TABULATE statements and cellwidths, this is what I see when Iook at the Spreadsheet Markup Language XML using Notepad:&lt;BR /&gt;
[pre]&lt;BR /&gt;
&amp;lt;Table ss:StyleID="_body"&amp;gt;&lt;BR /&gt;
&amp;lt;ss:Column ss:AutoFitWidth="1" ss:Width="165.6"/&amp;gt;&lt;BR /&gt;
&amp;lt;ss:Column ss:AutoFitWidth="1" ss:Width="45"/&amp;gt;&lt;BR /&gt;
&amp;lt;ss:Column ss:AutoFitWidth="1" ss:Width="72"/&amp;gt;&lt;BR /&gt;
&amp;lt;ss:Column ss:AutoFitWidth="1" ss:Width="72"/&amp;gt;&lt;BR /&gt;
&amp;lt;Row ss:AutoFitHeight="1" ss:Height="28"&amp;gt;&lt;BR /&gt;
&amp;lt;Cell ss:StyleID="header__c" ss:Index="1"&amp;gt;&amp;lt;Data ss:Type="String"&amp;gt;Area by Reasons&amp;lt;/Data&amp;gt;&amp;lt;/Cell&amp;gt;&lt;BR /&gt;
&amp;lt;Cell ss:StyleID="header__c1" ss:Index="2"&amp;gt;&amp;lt;Data ss:Type="String"&amp;gt;Area Total&amp;lt;/Data&amp;gt;&amp;lt;/Cell&amp;gt;&lt;BR /&gt;
&amp;lt;Cell ss:StyleID="header__c" ss:Index="3"&amp;gt;&amp;lt;Data ss:Type="String"&amp;gt;EAST&amp;lt;/Data&amp;gt;&amp;lt;/Cell&amp;gt;&lt;BR /&gt;
&amp;lt;Cell ss:StyleID="header__c" ss:Index="4"&amp;gt;&amp;lt;Data ss:Type="String"&amp;gt;WEST&amp;lt;/Data&amp;gt;&amp;lt;/Cell&amp;gt;&lt;BR /&gt;
&amp;lt;/Row&amp;gt;&lt;BR /&gt;
....more Spreadsheet ML XML ....&lt;BR /&gt;
&amp;lt;/Table&amp;gt;&lt;BR /&gt;
&amp;lt;/Worksheet&amp;gt;&lt;BR /&gt;
&amp;lt;/Workbook&amp;gt;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
ODS must convert the SAS cellwidths to the correct unit of measure for the XML specification that conforms to the Microsoft specification for Spreadsheet Markup Language XML. I note that AutoFitWidth XML attribute is set to "1" (which generally means ON) and that the size for the first column (Area by Reasons) is larger than the size for the other columns. This is Microsoft XML. ODS is writing what it considers to be the equivalent of your cellwidths. If you don't like how Microsoft Excel renders that XML, then either change the cellwidth until it looks closer to what you want or use the sub-options.&lt;BR /&gt;
 &lt;BR /&gt;
However, I have seen Excel just totally ignore any cellwidth that I specify. That's why the ABSOLUTE_COLUMN_WIDTH sub-option was created.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 08 Oct 2009 18:22:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75080#M8534</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-10-08T18:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: cellwidth and ExcelXP</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75081#M8535</link>
      <description>Cynthia, changing the cell width until it looks what what i need would be a simple enough solution, IF excel was responding to what I am setting it to.  But, my column width for this field is always 48 pixels, regardless of what i specify.&lt;BR /&gt;
&lt;BR /&gt;
Will specifying the option absolute_column_width change all of my columns?  Will it use the header to determine column width? How exactly does it work?</description>
      <pubDate>Thu, 08 Oct 2009 18:35:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75081#M8535</guid>
      <dc:creator>steve_citi</dc:creator>
      <dc:date>2009-10-08T18:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: cellwidth and ExcelXP</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75082#M8536</link>
      <description>Hi:&lt;BR /&gt;
  The times I have used the Absolute_Column_Width sub-option I have explicitly changed all my columns. For example, if I do this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data calif;&lt;BR /&gt;
  set sashelp.prdsale;&lt;BR /&gt;
  Area_Name= Country;&lt;BR /&gt;
  High_Level_Definition = Region;&lt;BR /&gt;
run;&lt;BR /&gt;
                    &lt;BR /&gt;
ods tagsets.excelxp file='calif2.xml' style=sasweb&lt;BR /&gt;
    options(absolute_column_width="30,10,7,7");&lt;BR /&gt;
                         &lt;BR /&gt;
PROC TABULATE data=calif;&lt;BR /&gt;
  CLASS Area_Name / order=freq;&lt;BR /&gt;
  CLASSLEV Area_Name ;&lt;BR /&gt;
  CLASS High_Level_Definition / order=freq;&lt;BR /&gt;
  CLASSLEV High_Level_Definition ;&lt;BR /&gt;
  Table (Area_Name ALL='Decision Total'*[style=&lt;PARENT&gt;]),&lt;BR /&gt;
        (ALL='Area Total'*[style={background=vpapb}] High_Level_Definition=" ")*(N=' ' *f=comma6.)&lt;BR /&gt;
     / BOX={label='Area by Reasons'} NOCONTINUED indent=3 ;&lt;BR /&gt;
   KEYWORD ALL / style=[background=vpapb];&lt;BR /&gt;
run; &lt;BR /&gt;
ods _all_ close;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
Then for my output, using SASHELP.PRDSALE, I see that the first column is significantly wider than the last 2 columns.&lt;BR /&gt;
 &lt;BR /&gt;
I am not exactly sure how column width works. In Excel, if I look at informatiion about column width settings, Excel says that (from the Excel help):&lt;BR /&gt;
&lt;B&gt;&lt;BR /&gt;
On a worksheet, you can specify a column width of 0 (zero) to 255. This value represents the number of characters that can be displayed in a cell that is formatted with the standard font (standard font: The default text font for worksheets. The standard font determines the default font for the Normal cell style.). The default column width is 8.43 characters. If a column has a width of 0 (zero), the column is hidden.&lt;BR /&gt;
&lt;/B&gt;&lt;BR /&gt;
 &lt;BR /&gt;
Then, on this Microsoft site, there's more information about column width:&lt;BR /&gt;
&lt;A href="http://support.microsoft.com/kb/214123" target="_blank"&gt;http://support.microsoft.com/kb/214123&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
  I don't exactly know how ODS deals with the numbers you send via the Absolute_column_width sub-option -- I surmise (but don't know for sure) that somehow the cell font is taken into account by ODS along with the absolute column width and it is some changed value that is being sent to Excel in XML form.&lt;BR /&gt;
&lt;BR /&gt;
  Personally, I don't stress over what ODS is doing. I take the "control freak" approach: and specify absolute column widths for EVERY column and change the numbers I send to ODS until what I see in Excel is what I want.&lt;BR /&gt;
 &lt;BR /&gt;
  If it is essential for you to understand -exactly- how ODS is dealing with the absolute_column_width sub-option, then your best resource is to contact Tech Support. I only know that when I use the absolute_column_width sub-option with TAGSETS.EXCELXP, I can always get Excel to render the columns showing a width that I am happy with.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;/PARENT&gt;</description>
      <pubDate>Thu, 08 Oct 2009 21:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/cellwidth-and-ExcelXP/m-p/75082#M8536</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-10-08T21:23:33Z</dc:date>
    </item>
  </channel>
</rss>

