BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am using PROC TABULATE and EXCELXP to create a table in Excel. Problem is, the column headings are long and the cell height doesn't expand to make the cell taller to fit the text. Have tried putting CELLHEIGHT in various places with no success.

I am using: Excel XP tagset (SAS 9.1.3, v1.86, 04/15/08).

Here's the code:

ods tagsets.ExcelXP file=Outfile options(AUTOFIT_HEIGHT='YES')
style=styles.mytab styles.Statistical ;

proc format;
value $division
'CONSUMER'="this is very long text for consumer"
'EDUCATION'="this is very long text for education";
run;

proc tabulate data=sashelp.prdsale;
format division $division.;
label division='this is a very long label for division. the cellheight needs to increase so that the value will fit';
class country region division ;
classlev country region division/style=[cellwidth=200px];

table (country),division*(n pctn)

;run;
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
When I try your code in SAS 9.2, with AUTOFIT, I see that Excel has just widened the table instead of wrapping the text. So, my long text was taken care of by the cell -width- being increased by Excel but I -do- see all the text in all the headers.

In the SAS Log, when I use the Doc='Help' suboption, it says this about the AUTOFIT_HEIGHT suboption:
[pre]
Autofit_height: Default Value 'no'
Values: yes, no, on, off.
If yes no row heights will be specified. This allows the auto fit height
of Excel to do it's job, sometimes not so well.

[/pre]

It seems that you are experiencing the "sometimes not so well" behavior. Perhaps Tech Support will know what combination of sub-options will cause the cell height in Excel to increase (and the text to wrap) as you want.

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 761 views
  • 0 likes
  • 2 in conversation