BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ColeG
Obsidian | Level 7

I am trying to control the row heights for a title that I have added to an ods excel output. Below is sample code with only the relevant sections:

ods excel file='C:\test.xlsx';
ods excel options(sheet_name='test' absolute_column_width='11,8' row_heights='14,3' embedded_titles='yes');

title box=2 bc=CX702082 bold color=white j=left height=12pt "Test Title";

proc report data=sashelp.class; run;

What I would like to have happen is to have a title that takes up rows 1 and 2 (this is automatic from the row statement): row one would have a height in Excel of 14, row two would have a height of 3 (from the row_heights option) and basically just exist to provide a narrow buffer between my title and my report.

 

However, what actually happens is that rows 1 and 2 have their default height, while row 3 (the first row from the report output) has a height of 14 and all subsequent rows have a height of 3; absolute column width affects all columns starting with column A (width 11, followed by widths of 8). Why does row_heights not seem to work in the same way as absolute_column_width and is there a way to control the height of the title rows using ods excel options?

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  The values for row_heights sub-option are positional. The 4th value is the TITLES value. When I do this:

row_heights_ods_excel.png

 

I get a higher title. It doesn't span rows 1 and 2, but row 1 is taller than the other rows. Specifying a 0 for a "position" that I don't want to change tells ODS to use the value set by default in the current style being used for the output (in this case, HTMLBLUE). I fiddled with the number to use, 14 didn't seem big enough to be obvious, so I made it 30.

 

Hope this helps,

cynthia

View solution in original post

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

Hi:

  The values for row_heights sub-option are positional. The 4th value is the TITLES value. When I do this:

row_heights_ods_excel.png

 

I get a higher title. It doesn't span rows 1 and 2, but row 1 is taller than the other rows. Specifying a 0 for a "position" that I don't want to change tells ODS to use the value set by default in the current style being used for the output (in this case, HTMLBLUE). I fiddled with the number to use, 14 didn't seem big enough to be obvious, so I made it 30.

 

Hope this helps,

cynthia

ColeG
Obsidian | Level 7

Thank you so much, Cynthia! I don't think I ever would have thought to even look that up! I just assumed it would function similarly to column width. And if I set a value for position 7 I can make row 2 narrower to bring the title closer to the report.

 

As an unrelated follow-up: it seems like VJUST doesn't work in a TITLE statement like this; can I only get that from applying a template to the title?

Cynthia_sas
SAS Super FREQ

Hi:

  Yes, I think you need a template change, but it's not a hard change:

template_vjust.png

Hope this helps,

Cynthia

ColeG
Obsidian | Level 7

Yep, thank you so much for your help!

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
  • 4 replies
  • 11039 views
  • 6 likes
  • 2 in conversation