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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1911 views
  • 0 likes
  • 3 in conversation