Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink in footnote & Pop-up window (ODS) 1

Status
Not open for further replies.

Kosa13

MIS
Mar 13, 2007
10
0
0
PL
Hello,
I have 2 questions...

1) How to put shortcut (link) to my e-mail in footnote ?
2) How to show pop-up window with text "No data..." if file in "_val_" link does not exist ?

Example code:

/****************************/
Data X;
Input Letters $1.;

Cards;
A
B
C
D
E
F
;
Run;


Proc Template;
Define Table My_HTML;
Column Letters;

Define Letters;
Just=C;
Cellstyle _val_ = 'A' as {url= "C:\Temp\File_1.jpg"},
_val_ = 'B' as {url= "C:\Temp\File_2.jpg"},
_val_ = 'C' as {url= "C:\Temp\File_3.jpg"},
_val_ = 'D' as {url= "C:\Temp\File_4.jpg"},
_val_ = 'E' as {url= "C:\Temp\File_5.jpg"},
_val_ = 'F' as {url= "C:\Temp\File_6.jpg"};
End;

End;
Run;

ODS HTML BODY="C:\Temp\MY_FILE.html" Style=MAGNIFY;

TITLE "SHORTCUTS";

Data _null_;
Set X;
File print Ods=(Template='My_HTML');
Put _ods_;
Run;
Footnote ' ';
Footnote1 COLOR="BLACK" JUSTIFY=LEFT HEIGHT=2.0 "AUTHOR:";
Footnote2 COLOR="BLACK" JUSTIFY=LEFT HEIGHT=2.0 "AUTHOR@CONTACT_MAIL.PL";
ODS HTML CLOSE;

/****************************/

Thanks for help...
 
Kosa13,
Your first request is easier than then your second.
How to enter a linkable email address in a footnote.
(This will only work in the ODS HTML and not the PDF ODS)

Insert the following in your FOOTNOTE statement:
"<a href=author@contact_mail.pl>AUTHOR@CONTACT_MAIL.PL</a>"

Now your second question needs thought. My idea is to insert a javascript function that will do what you ask, but I need to try it first.
Klaz
 
OK I found a way to display images in a Pop-up style from a SAS ODS output.

You will need to use a javascript inclusion file and a html template.

Save your external JS file using the .js extention. (ex. imageview.js)
This is how it should look.
Code:
function imv (imgpath)
{
  smallWin = window.open('b.htm?'+imgpath,"Small","width=200, height=220, toolbar=0, status=0");

}

Your HTM template file should look like this:
Code:
<html>
<script >
function getP()
{
 var imgPath = '';
 var urlpath = window.location.href;
 var ipath   = urlpath.substr(urlpath.indexOf("?")+1);
 document.images[0].src = ipath;
}
</script>
<body onLoad=javascript:getP(); onMouseOut=javascript:window.close();>

<img src="" alt="No Image Found"></img>
</body>
</html>

Now your data should put together the following string. (you can use formats to substitute strings if you need to.)
Code:
yourdatavar= '<a href="" onMouseOver=javascript:imv("'||trim(imgpath)||'"); >'||trim(imgpath)||'</a>';
Now your sas program should put the above string together. Then use a proc print or report to output the data via ODS HTML.

Finaly, you must put this code in the title statement.
Code:
title "<script src='t.js'></script>";

Of course you may need to play with the filenames as the scope may get in the way.

This is all a sample and you should be able to modify this code based on the concept that I put down here.
Hope that this helps you.
Klaz
 
One more thing,
Remember to use the tranwrd() function to 'pad' the '\' that make up the image path.
Klaz
 
Hi,
I tested footnote like this earlier but this code
Footnote "<a href=author@contact_mail.pl>AUTHOR@CONTACT_MAIL.PL</a>"

linkin my DISK (path) "C:\Temp\AUTHOR@CONTACT_MAIL.PL"
(not my e-mail) and I have screen with text "The page cannot be displayed". Any ideas ?


To my second question...
I never used Java scripts before, but hanks for Your code.
I study him now :) I must more read about this.
 
The code for the footnote should read like this:
"<a href=mailto:author@contact_mail.pl>AUTHOR@CONTACT_MAIL.PL</a>"
 
Thanks for Your help klaz2002.
Now it's working correct.
I could not find this in SUGI.
Thanks... Thanks... Thanks...
 
Hello everyone,
I still have problems with Footnote and Title in ODS and I have some more questions to using them.

My questions is:
1) In Title1 I have good image, but in Title 2 I have image with Hyperlink and image in Title2 is arounded by purple border. How to remove this border ??? I used options “noborder”, “bordercolor” and nothing is happend.

2) How to justify (resize) Image from border to border (from left to right) ?

3) If we uncomment Title3 then Title1 and Title2 moving to left and I can’t move theme to CENTER position? What happened here ?

4) Last question: how to move My footnote to bottom of Page ?


Thanks for help…


Example code:

/*********************************/
Data X;
Input Letters $1.;

Cards;
A
B
C
D
E
;
Run;

Proc Template;
Define Table My_HTML;
Column Letters;

Define Letters;
Just=C;

Cellstyle _val_ = 'A' as {url= "C:\Temp\File_1.jpg"},
_val_ = 'B' as {url= "C:\Temp\File_2.jpg"},
_val_ = 'C' as {url= "C:\Temp\File_3.jpg"},
_val_ = 'D' as {url= "C:\Temp\File_4.jpg"},
_val_ = 'E' as {url= "C:\Temp\File_5.jpg"};
End;

End;
Run;

ODS escapechar='^';
ODS HTML BODY="C:\Temp\MY_FILE.html" Style=MAGNIFY;

TITLE1 JUSTIFY=CENTER '^S={preimage="C:\line.GIF" }';
TITLE2 JUSTIFY=CENTER '<A HREF="C:\">^S={preimage="C:\image.GIF" }</A>';



/*TITLE3 JUSTIFY=LEFT '^S={preimage="C:\Home.GIF"}'*/
/* JUSTIFY=CENTER font='Times New Roman' height=20pt "SHORTCUTS" */
/* JUSTIFY=RIGHT '^S={postimage="C:\Home.GIF"}';*/

Footnote10 "My footnote";

Data _null_;
Set X;
File print Ods=(Template='My_HTML');
Put _ods_;
Run;

ODS HTML CLOSE;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top