The SAS Output Delivery System and reporting techniques

ODS html basic link in footnote

Accepted Solution Solved
Reply
PROC Star
Posts: 1,291
Accepted Solution

ODS html basic link in footnote

Hi,

I'm using ODS HTML with SAS 9.3 and want a simple footnote with a link in it.  Below are four attempts:

footnote1 h=3 "Visit <a href=""http://www.sas.com""> SAS </a>";

footnote2 h=3 "<p> Visit <a href=""http://www.sas.com""> SAS </a>";

footnote3 h=3 "<p> Visit <a href=""http://www.sas.com""> SAS </a> to see good stuff";

footnote4 h=3 "<p> Visit <a href=""http://www.sas.com""> SAS to see good stuff</a>";

Footnote1 does not work.  The angle brackets are htmlencoded into &lt etc, and I don't get a link.

Someone said if I added <p> to the front, SAS would know this is html code, and would leave the tags alone.  Footnote2 works.

Then I wanted to add some text after the link.  Footnote 3 does not work.  Again, the angle brackets get encoded.

Footnote4 does work, because now there is no text after the link.  Instead  "to see good stuff" is part of the link.

Any way to get footnote3 to work?

Should I be doing this a different way?

Actual setting is Stored Process Web App where footnotes will let users drill down.  But I see the same with just base SAS ods html.

Thanks,

--Q.


Accepted Solutions
Solution
‎05-12-2014 10:42 AM
SAS Employee
Posts: 88

Re: ODS html basic link in footnote

By default if the first and last character are not tags, the tag in between gets encoded. You can add HTML blocking tags to the beginning  and end of the footnote statement or use the PROTECTSPACIALCHARS= style attribute within the SystemFooter style element.

footnote1 h=3 '<span>Visit <a href="http://www.sas.com"> SAS </a>'</span>;

footnote2 h=3 '<span> Visit <a href="http://www.sas.com"> SAS </a></span>';

footnote3 h=3 '<span> Visit <a href="http://www.sas.com"> SAS </a> to see good stuff'</span>;

footnote4 h=3 '<span> Visit <a href="http://www.sas.com"> SAS to see good stuff</a></span>';

View solution in original post


All Replies
Super User
Super User
Posts: 7,720

Re: ODS html basic link in footnote

Hi,

I would suggest that you check your quote marks.  I copied this into SAS and I see there is a quote before the <p>, then two before the http, two after, then a final one.  Maybe set double quote 1 and last one to single:

E.g.

h=3 '<p> Visit <a href="http://www.sas.com"> SAS </a>';

Super User
Super User
Posts: 7,720

Re: ODS html basic link in footnote

So without the formatting:

footnote1 h=3 'Visit <a href="http://www.sas.com"> SAS </a>';

footnote2 h=3 '<p> Visit <a href="http://www.sas.com"> SAS </a>';

footnote3 h=3 '<p> Visit <a href="http://www.sas.com"> SAS </a> to see good stuff';

footnote4 h=3 '<p> Visit <a href="http://www.sas.com"> SAS to see good stuff</a>';

Solution
‎05-12-2014 10:42 AM
SAS Employee
Posts: 88

Re: ODS html basic link in footnote

By default if the first and last character are not tags, the tag in between gets encoded. You can add HTML blocking tags to the beginning  and end of the footnote statement or use the PROTECTSPACIALCHARS= style attribute within the SystemFooter style element.

footnote1 h=3 '<span>Visit <a href="http://www.sas.com"> SAS </a>'</span>;

footnote2 h=3 '<span> Visit <a href="http://www.sas.com"> SAS </a></span>';

footnote3 h=3 '<span> Visit <a href="http://www.sas.com"> SAS </a> to see good stuff'</span>;

footnote4 h=3 '<span> Visit <a href="http://www.sas.com"> SAS to see good stuff</a></span>';

PROC Star
Posts: 1,291

Re: ODS html basic link in footnote

Thanks    , that makes sense.

I had tried using ProtectSpecialChars in inline formatting, but guess that won't work. 

SAS Employee
Posts: 88

Re: ODS html basic link in footnote

You are correct, as this will not be applied when added via inline formatting.

PROC Star
Posts: 1,291

Re: ODS html basic link in footnote

Thanks @RW9, but the double double quotes were intentional.  I tried your suggestion and got the same results.

Super User
Posts: 9,867

Re: ODS html basic link in footnote

Check style.

ods escapechar='~';

footnote1 h=3 "Visit ~S={url='www.sas.com' hreftag='blank'  } SAS ";

PROC Star
Posts: 1,291

Re: ODS html basic link in footnote

Thanks Ksharp, looks like using in-line formatting may work. To get the text at the end to be not part of the link, I added a null style:

footnote1 h=3 "Visit ~S={url='www.sas.com' } SAS~S={} to see good stuff";

🔒 This topic is solved and locked.

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

Discussion stats
  • 8 replies
  • 1287 views
  • 3 likes
  • 4 in conversation