<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Hyperlinks via ODS are not hyperlinks in Excel if link text is too long, even with flow=tables in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597589#M23399</link>
    <description>&lt;P&gt;I want to make hyperlinks in Excel -- so that the user would open the spreadsheet and see some cells with (familiar) blue, underlined text which are hyperlinks to a URL HREF&amp;nbsp; (http://...).&amp;nbsp; One click on the &amp;lt;text&amp;gt; to the link, and the web browser opens up.&amp;nbsp; &amp;nbsp;I created a column in a dataset where the char content is '=HYPERLINK("&amp;lt;link&amp;gt;","&amp;lt;text&amp;gt;")'.&amp;nbsp; &amp;nbsp;If Excel sees '=HYPERLINK(...)' then it &lt;EM&gt;should&lt;/EM&gt; create the link, right?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I started with proc export dbms=xlsx, but when I opened the xlsx file in Excel app, it would show the "=HYPERLINK(...)" text and &lt;U&gt;not&lt;/U&gt; the (blue) hyperlink &amp;lt;text&amp;gt; with the link "hidden".&amp;nbsp; &amp;nbsp;That is, the cell is not a hyperlink.&amp;nbsp; &amp;nbsp;However, if they "edit" that cell, change nothing, and resubmit the exact text, then Excel will "recognize" the =HYPERLINK() function and convert the cell to the (blue) hyperlink &amp;lt;text&amp;gt; (as desired) .&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I read up on ods excel with the options(flow='tables').&amp;nbsp; So I tried that.&amp;nbsp; Now it gets interesting.&amp;nbsp; For "long" &amp;lt;links&amp;gt; (as in string length # chars), the Excel app shows the '=HYPERTEXT(...)' text, i.e. the cell is &lt;U&gt;not&lt;/U&gt; a hyperlink.&amp;nbsp; &amp;nbsp; But if the links are all "short" (as in &amp;lt; 50 chars in length) then the cell &lt;STRONG&gt;IS&lt;/STRONG&gt; a hyperlink and a nice short "click here" text shows up blue and clickable (what I want).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There seems to be going on with the string length of the &amp;lt;link&amp;gt; -- but options(flow='tables') didn't 100% solve it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example code attached.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Excel:&amp;nbsp; Office 2019&lt;/P&gt;
&lt;P&gt;SAS Current version: 9.04.01M6&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Oct 2019 02:00:36 GMT</pubDate>
    <dc:creator>ruegsegs_us_ibm_com</dc:creator>
    <dc:date>2019-10-18T02:00:36Z</dc:date>
    <item>
      <title>Hyperlinks via ODS are not hyperlinks in Excel if link text is too long, even with flow=tables</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597589#M23399</link>
      <description>&lt;P&gt;I want to make hyperlinks in Excel -- so that the user would open the spreadsheet and see some cells with (familiar) blue, underlined text which are hyperlinks to a URL HREF&amp;nbsp; (http://...).&amp;nbsp; One click on the &amp;lt;text&amp;gt; to the link, and the web browser opens up.&amp;nbsp; &amp;nbsp;I created a column in a dataset where the char content is '=HYPERLINK("&amp;lt;link&amp;gt;","&amp;lt;text&amp;gt;")'.&amp;nbsp; &amp;nbsp;If Excel sees '=HYPERLINK(...)' then it &lt;EM&gt;should&lt;/EM&gt; create the link, right?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I started with proc export dbms=xlsx, but when I opened the xlsx file in Excel app, it would show the "=HYPERLINK(...)" text and &lt;U&gt;not&lt;/U&gt; the (blue) hyperlink &amp;lt;text&amp;gt; with the link "hidden".&amp;nbsp; &amp;nbsp;That is, the cell is not a hyperlink.&amp;nbsp; &amp;nbsp;However, if they "edit" that cell, change nothing, and resubmit the exact text, then Excel will "recognize" the =HYPERLINK() function and convert the cell to the (blue) hyperlink &amp;lt;text&amp;gt; (as desired) .&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I read up on ods excel with the options(flow='tables').&amp;nbsp; So I tried that.&amp;nbsp; Now it gets interesting.&amp;nbsp; For "long" &amp;lt;links&amp;gt; (as in string length # chars), the Excel app shows the '=HYPERTEXT(...)' text, i.e. the cell is &lt;U&gt;not&lt;/U&gt; a hyperlink.&amp;nbsp; &amp;nbsp; But if the links are all "short" (as in &amp;lt; 50 chars in length) then the cell &lt;STRONG&gt;IS&lt;/STRONG&gt; a hyperlink and a nice short "click here" text shows up blue and clickable (what I want).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There seems to be going on with the string length of the &amp;lt;link&amp;gt; -- but options(flow='tables') didn't 100% solve it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example code attached.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Excel:&amp;nbsp; Office 2019&lt;/P&gt;
&lt;P&gt;SAS Current version: 9.04.01M6&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 02:00:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597589#M23399</guid>
      <dc:creator>ruegsegs_us_ibm_com</dc:creator>
      <dc:date>2019-10-18T02:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Hyperlinks via ODS are not hyperlinks in Excel if link text is too long, even with flow=tables</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597590#M23400</link>
      <description>&lt;P&gt;Is this my answer:&amp;nbsp; &lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlink-from-ODS-Excel-to-external/m-p/579186#M23126" target="_self"&gt;link&lt;/A&gt;?&amp;nbsp; Do I &lt;EM&gt;have&lt;/EM&gt; to change my proc print to a proc report?&amp;nbsp; (I'm not as proficient in proc report.)&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 02:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597590#M23400</guid>
      <dc:creator>ruegsegs_us_ibm_com</dc:creator>
      <dc:date>2019-10-18T02:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Hyperlinks via ODS are not hyperlinks in Excel if link text is too long, even with flow=tables</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597714#M23401</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Take a look at this previous posting with a PROC REPORT example:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlink-from-ODS-Excel-to-external/m-p/579186/highlight/true#M23126" target="_blank"&gt;https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlink-from-ODS-Excel-to-external/m-p/579186/highlight/true#M23126&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I think that will get you started.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 13:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597714#M23401</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-10-18T13:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Hyperlinks via ODS are not hyperlinks in Excel if link text is too long, even with flow=tables</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597821#M23402</link>
      <description>&lt;P&gt;Thanks Cynthia.&amp;nbsp; Exactly.&amp;nbsp;&amp;nbsp;I thought I would get pointed to PROC REPORT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, to clarify...&amp;nbsp; the problem I described cannot be &lt;EM&gt;solved&lt;/EM&gt; with a proc print (in ods) -- correct?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore, the &lt;EM&gt;"only"&lt;/EM&gt; solution is to change over from a proc print to a proc report -- correct?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Those two statements are how I'm interpreting the solutions I'm seeing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 20:19:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597821#M23402</guid>
      <dc:creator>ruegsegs_us_ibm_com</dc:creator>
      <dc:date>2019-10-18T20:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Hyperlinks via ODS are not hyperlinks in Excel if link text is too long, even with flow=tables</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597833#M23403</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I would not expect the PROC EXPORT method to work at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I can envision PROC PRINT working, possibly. However, my "go-to" procedure of choice would be PROC REPORT because the URL capability was built into PROC REPORT's COMPUTE block. THIS Proc Print code works for me in both HTML and ODS Excel:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
title; footnote;

proc format;
  value $nfmt 'Alfred'='https://www.google.com/search?&amp;amp;q=Alfred+Lord+Tennyson'
              'Alice'='https://www.google.com/search?&amp;amp;q=Alice+in+Wonderland'
              'Barbara'='https://www.google.com/search?&amp;amp;q=Barbara+Kingsolver';
run;

ods excel file='c:\temp\testurl.xlsx';

proc print data=sashelp.class(obs=3);
  var name / style(data)={url=$nfmt.};
  var age height weight;
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; In Excel, I have to float my mouse over the cell (which is not highlighted like a hyperlink), but then I&amp;nbsp; see a message to click once to follow the link or hold and click to select the cell....but the link works. However, if I just change some more style attributes, then both PRINT and REPORT will make the NAME look like a Hyperlink:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;** proc print;
title; footnote;

proc format;
  value $nfmt 'Alfred'='https://www.google.com/search?&amp;amp;q=Alfred+Lord+Tennyson'
              'Alice'='https://www.google.com/search?&amp;amp;q=Alice+in+Wonderland'
              'Barbara'='https://www.google.com/search?&amp;amp;q=Barbara+Kingsolver';
run;

ods excel file='c:\temp\testurl.xlsx';

proc print data=sashelp.class(obs=3);
  var name / style(data)={url=$nfmt. color=cx0000FF textdecoration=underline};
  var age height weight;
run;

ods excel close;

** proc report;
title; footnote;
         

ods excel file='c:\temp\testurl2.xlsx';

proc report data=sashelp.class(obs=3);
  column name age height weight;
  define name / style(column)={url=$nfmt. color=cx0000FF textdecoration=underline};
run;

ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(last thought -- if your URLs are fixed, then I think you can make PROC PRINT work. If you need your URLs to be dynamically created, then you might have to use PROC REPORT and a COMPUTE block.)&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 21:22:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597833#M23403</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-10-18T21:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Hyperlinks via ODS are not hyperlinks in Excel if link text is too long, even with flow=tables</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597837#M23404</link>
      <description>&lt;P&gt;I think that Proc Print would require the Style element URL or possibly HREFTARGET to be set to appear the way you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To make the link change with the value of the variable you want to display I suspect you would need a format to associate the URL text with the value as is done to change colors for report highlighting. Something that would look like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc print data=foobar;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; var&amp;nbsp; url / style (data) = [url= formatforhref. ];&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a data set with the values and the needed text it is pretty simple to make a format with the cntlin feature of proc format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2019 21:23:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597837#M23404</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-18T21:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Hyperlinks via ODS are not hyperlinks in Excel if link text is too long, even with flow=tables</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597847#M23405</link>
      <description>Thanks. I'll dig into the proc print styles  (that's new to me too)</description>
      <pubDate>Fri, 18 Oct 2019 23:23:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597847#M23405</guid>
      <dc:creator>ruegsegs_us_ibm_com</dc:creator>
      <dc:date>2019-10-18T23:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Hyperlinks via ODS are not hyperlinks in Excel if link text is too long, even with flow=tables</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597855#M23406</link>
      <description>Hi:&lt;BR /&gt;  Here's a paper that will get you started. It shows style overrides with PRINT, REPORT and TABULATE.&lt;BR /&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings13/366-2013.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings13/366-2013.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
      <pubDate>Sat, 19 Oct 2019 00:07:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/597855#M23406</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-10-19T00:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Hyperlinks via ODS are not hyperlinks in Excel if link text is too long, even with flow=tables</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/643618#M24013</link>
      <description>&lt;P&gt;Hi Cynthia_sas,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thank you so much for this, it helps a lot. When I try your second approach I get the entire column showing up as underlined and blue. How can I write this so that only the codes with the hyperlink show up as blue and underlined?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 14:31:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/643618#M24013</guid>
      <dc:creator>Smora0713</dc:creator>
      <dc:date>2020-04-28T14:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Hyperlinks via ODS are not hyperlinks in Excel if link text is too long, even with flow=tables</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/739989#M24993</link>
      <description>Cynthia, You Rock!</description>
      <pubDate>Sat, 08 May 2021 19:07:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Hyperlinks-via-ODS-are-not-hyperlinks-in-Excel-if-link-text-is/m-p/739989#M24993</guid>
      <dc:creator>avellani</dc:creator>
      <dc:date>2021-05-08T19:07:52Z</dc:date>
    </item>
  </channel>
</rss>

