BookmarkSubscribeRSS Feed
PaigeMiller
Diamond | Level 26

I am trying to create a spreadsheet using ODS EXCEL. Everything comes out properly, except for the hyperlinks.

 

As you can see, I am trying to use the HYPERLINK command to create the hyperlink and the text in the cell. (By the way, this works in ODS TAGSETS.EXCELXP). However, the B5 cell, the cell selected in the screen capture, does not recognize the text as a hyperlink. In fact, if you look at the text box (highlighted in red) where the actual text of the cell is displayed, the text is split across three lines.

 

Mixed_NoScrub_AA277_WFR_Split.gif

 

If I manually remove the line breaks by editing the text box so all text is on one line, then the hyperlink works, as shown in the next screen capture.

 

Mixed_NoScrub_AA277_WFR_Split2.gif

 

How do I fix this? Or is this a bug?

--
Paige Miller
4 REPLIES 4
Ksharp
Super User

Can you use STYLE to get it ?

style={url='.........'} 

OR

" ~S={url='.......' } sqrt(Pixel......) "

PaigeMiller
Diamond | Level 26

There's still something going on that I don't understand, seems like a bug to me. The text that I want to write in the field still shows line breaks in Excel, when the input data has no line breaks or other non-printing characters.

 

Mixed_NoScrub_AA277_WFR_SplitAnal.gif

 

 

 

 

--
Paige Miller
Dan_Miller
Calcite | Level 5

I know this question is now over a year old but I have come across it a couple of times while looking into how to do hyperlinks. Just found what your problem would have been related to while reading this:

 

http://blogs.sas.com/content/sgf/2017/02/20/tips-for-using-the-ods-excel-destination/

 

'When text wraps, a hard return is added automatically to the cell ' so you either need to set the width of the cell in which you want the hyperlink wide enough that it dosn't need to wrap or use the flow option to stop the automatic wrapping:

 

ods excel file="c:\temp.xlsx" options(flow="tables");

 

Hope this is useful to someone...

PaigeMiller
Diamond | Level 26

@Dan_Miller wrote:

I know this question is now over a year old but I have come across it a couple of times while looking into how to do hyperlinks. Just found what your problem would have been related to while reading this:

 

http://blogs.sas.com/content/sgf/2017/02/20/tips-for-using-the-ods-excel-destination/

 

'When text wraps, a hard return is added automatically to the cell ' so you either need to set the width of the cell in which you want the hyperlink wide enough that it dosn't need to wrap or use the flow option to stop the automatic wrapping:

 

ods excel file="c:\temp.xlsx" options(flow="tables");

 

Hope this is useful to someone...


As I have switched jobs and no longer have my data to test this out, I would like to believe that this is the correct solution, but can't confirm it. Nevertheless, I thank you for the information, I have bookmarked this in case I run into this problem again.

--
Paige Miller

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
  • 3158 views
  • 2 likes
  • 3 in conversation