<?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: Proc report : Exporting to excel changes width/height of row/columns.. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Exporting-to-excel-changes-width-height-of-row/m-p/814489#M321470</link>
    <description>&lt;P&gt;This is an example of how I control the cell width when using ODS EXCEL:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define business_name / 'Business Name' style(column)=[cellwidth=1.25in];&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 20 May 2022 21:05:41 GMT</pubDate>
    <dc:creator>average_joe</dc:creator>
    <dc:date>2022-05-20T21:05:41Z</dc:date>
    <item>
      <title>Proc report : Exporting to excel changes width/height of row/columns..</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Exporting-to-excel-changes-width-height-of-row/m-p/814450#M321456</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I couldn't find an appropriate solution to my problem and maybe i am confusing height/width options..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am doing a proc report that i want to export to excel with ODS EXCEL.&lt;/P&gt;
&lt;P&gt;Even if the results shown in the HTML&amp;nbsp; output are fine, when exporting to excel, it's not giving the&amp;nbsp; expected output.&lt;/P&gt;
&lt;P&gt;I have headers, columns,... and some should have a&amp;nbsp; different size than others in excel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What i want to be displayed is something like this (due to confidentiality x corresponds to text and 999 999 to different numbers that can go from 0 to billions) :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="isgnr_1-1653055868419.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71665iB4E1533B5B0367D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="isgnr_1-1653055868419.png" alt="isgnr_1-1653055868419.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If you pay attention, the columns don't have same size. I need the first 3 one (with text) to be longer than the ones with numbers. Plus, ROW 7 contains headers so i want the entire row to be bigger than cell with values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've tried many options, from playing with style(column)=[width...] to adding options to ODS EXCEL and here is the last thing that i did:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
title1 color=blue bcolor=blue ''; 
title2 color=blue bcolor=blue '';
title3 color=blue bcolor=blue ''; 
 
ods excel file ="..xlsx" 
	options(embedded_titles='yes'  hidden_rows='4' flow="header,data,tables" blank_sheet="INFORMATION"
absolute_column_width='15,10,15,10,10,10,10,10' absolute_row_height='15' ) ;

ods escapechar= '^' ;
options missing=0 orientation=landscape center;&lt;BR /&gt;
proc report data= data split='~' nowd  center 
	style(header)={ background=white borderwidth=1 bordercolor=black color=black /*width=150*/ just=c textalign=c tagattr="wrap:no" vjust=m asis=on} 
	style(report)={borderwidth=1 bordercolor=black just=r}
	style(column)= { borderwidth=1 bordercolor=black just=r color=black  tagattr='format:###,###,###,###,###0' }
	style(summary)= [just=c textalign=c];

column ('^{style[color=red]location xxxxxx}' var1 var2 var3 var4 var5 ...) ;

define var1 /  group width=132 ; 
define var2  / group style(column)=[width=2.5in]; 
define var3 / group ; 
define var4 / analysis sum ; 
define var5 / analysis sum ; 
.... /analysis sum ; 

run ; 

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What i get is this kind of output :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="isgnr_2-1653056480667.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71666iDF42FF6D1ECD344F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="isgnr_2-1653056480667.png" alt="isgnr_2-1653056480667.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) This the size i want for row values but not for headers in row 7 because we can't read the entire header. I think that in the ods excel instruction 'ABSOLUTE_ROW_HEIGHT = 15' is applied to the entire sheet.&lt;/P&gt;
&lt;P&gt;2) I think that i am missing or misunderstanding some things : width, cellwidth , height options...&lt;/P&gt;
&lt;P&gt;3) The best result that i would like is that excel adjust automatically each column and row to its content when exporting just like it is possible to do it so manually in excel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry if it's a bit confusing. I can't provide data or the entire code due to confidentiality.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 14:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Exporting-to-excel-changes-width-height-of-row/m-p/814450#M321456</guid>
      <dc:creator>elsfy</dc:creator>
      <dc:date>2022-05-20T14:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report : Exporting to excel changes width/height of row/columns..</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Exporting-to-excel-changes-width-height-of-row/m-p/814489#M321470</link>
      <description>&lt;P&gt;This is an example of how I control the cell width when using ODS EXCEL:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define business_name / 'Business Name' style(column)=[cellwidth=1.25in];&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 20 May 2022 21:05:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Exporting-to-excel-changes-width-height-of-row/m-p/814489#M321470</guid>
      <dc:creator>average_joe</dc:creator>
      <dc:date>2022-05-20T21:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report : Exporting to excel changes width/height of row/columns..</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-report-Exporting-to-excel-changes-width-height-of-row/m-p/814548#M321502</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
title1 color=blue bcolor=blue ''; 
title2 color=blue bcolor=blue '';
title3 color=blue bcolor=blue ''; 
ods escapechar= '^' ;
ods excel file='c:\temp\want.xlsx' options(sheet_name='class' embedded_titles='yes'  hidden_rows='4');
proc report data=sashelp.class nowd style(header)={cellheight=2cm};
column ('^{style[color=red]location xxxxxx}' name sex weight height) ;
define name/display style={cellwidth=2cm};
define sex/display style={cellwidth=2cm};
define weight/display style={cellwidth=1cm};
define height/display style={cellwidth=1cm};
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1653130014784.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71682i5F923DEE9B427AE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1653130014784.png" alt="Ksharp_0-1653130014784.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2022 10:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-report-Exporting-to-excel-changes-width-height-of-row/m-p/814548#M321502</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-05-21T10:47:02Z</dc:date>
    </item>
  </channel>
</rss>

