The SAS Output Delivery System and reporting techniques

Wrapping of flyover text in ODS EXCEL

Accepted Solution Solved
Reply
Contributor
Posts: 35
Accepted Solution

Wrapping of flyover text in ODS EXCEL

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;

Accepted Solutions
Solution
‎02-13-2017 04:18 PM
SAS Super FREQ
Posts: 8,819

Re: Wrapping of flyover text in ODS EXCEL

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


All Replies
Solution
‎02-13-2017 04:18 PM
SAS Super FREQ
Posts: 8,819

Re: Wrapping of flyover text in ODS EXCEL

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

Contributor
Posts: 35

Re: Wrapping of flyover text in ODS EXCEL

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.
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 413 views
  • 0 likes
  • 2 in conversation