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

Hello SAS people

 

Does anyone know if it is possible to control the wrapping of flyover text of a proc report column header in ODS EXCEL?

 

Purely to illustrate I have concocted a daft bit of flyover text for the sex variable which results in the M for Males not starting on its own line in the flyver text, at least not when I run the code.

 

All advice appreciated. 

 

Thanks.

 

Am running SAS 9.4M4. 

 

ods excel file='\\....\mytestfile.xlsx' options (sheet_name="My Sheet");

proc report data=sashelp.class style(header)={backgroundcolor=white color=black textalign=left fontfamily='Courier New' fontsize=8pt} 
style(column)={fontfamily='Courier New' fontsize=8pt};
define name /style(header)={flyover='This is the persons name'};
define sex /style(header)={flyover='This is the recorded value of a persons sex: M=Male F=Female'};
define age /style(header)={flyover='This is the persons age'};
define height /style(header)={flyover="This is the persons height"};
define weight/style(header)={flyover='This is the persons weight'};
run;

ods excel close;
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi,

  It took a few tries and some reverse engineering, but it looks like if you take SAS out of the picture and just make a tooltip in Excel and use Alt+Enter in the tooltip, then what Excel inserts into the flyover window seems to be _x000a_ as shown in the XML below for the flyover where M=Male does start a new line.

 

cynthia

 

Here's the final SAS code and results:

flyover_excel.png

 

If you are interested in the reverse engineering, I made a worksheet, put some typing in a cell, and then went to Data -->Data Validation and entered the text using Alt+Enter for my line feed. Then I examined the XML generated for my 2 cell sheet and you can see the _x000a_ string at the 2 places I used Alt+Enter:

make_tooltip.png

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi,

  It took a few tries and some reverse engineering, but it looks like if you take SAS out of the picture and just make a tooltip in Excel and use Alt+Enter in the tooltip, then what Excel inserts into the flyover window seems to be _x000a_ as shown in the XML below for the flyover where M=Male does start a new line.

 

cynthia

 

Here's the final SAS code and results:

flyover_excel.png

 

If you are interested in the reverse engineering, I made a worksheet, put some typing in a cell, and then went to Data -->Data Validation and entered the text using Alt+Enter for my line feed. Then I examined the XML generated for my 2 cell sheet and you can see the _x000a_ string at the 2 places I used Alt+Enter:

make_tooltip.png

ABritinAus
Obsidian | Level 7
Thanks Cynthia - that works really well. I will look at the underlying XML in future when trying to work out such things - thanks for the tip.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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