BookmarkSubscribeRSS Feed
sworobec1
Calcite | Level 5

Hello All,

I'm using the below program to output to excel. I'm getting a lot of rows that are too high. I suspect this is because SAS is looking at the row that's the highest (there's one that has a lot more text in one column than the others) and setting all row heights to match it. How do I make it so the heights are dynamic for each row?  

 

ODS LISTING CLOSE;

ods excel file="folder\test.xlsx"

style=htmlblue;

ods excel options(

flow='tables'

sheet_name ='test'

embedded_titles='yes'

sheet_interval="none"

orientation='landscape');

Title 'a title';

run;

PROC PRINT DATA= test noobs;

RUN;

ODS _ALL_ CLOSE;

 

2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
Without some test data, nobody can run your program. Can you mock up an example using SASHELP.CLASS that shows the behavior you describe?
Cynthia
RichardDeVen
Barite | Level 11

This code does not demonstrate 'all rows too tall', only the row with long text 'wrapped'.

 

data cars;
  retain make model;
  length model $500;
  set sashelp.cars(obs=10);
  if _n_ = 7 then model = repeat(trim(model),25);
run;

ODS _ALL_ CLOSE;

ods excel file="test.xlsx" style=htmlblue
  options(
    flow = 'tables'
    sheet_name = 'test'
    embedded_titles = 'yes'
    sheet_interval = "none"
    orientation = 'landscape'
  );

PROC PRINT DATA=cars noobs;
  Title '10 of the Cars data';
RUN;

ODS _ALL_ CLOSE;

RichardADeVenezia_0-1596511873388.png

 

You might have data with leading spaces, hard spaces (A0x), or semi-long data that is not being measured and layed out by ODS EXCEL according to 'human-eye'  'font-point' expectations.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1903 views
  • 0 likes
  • 3 in conversation