Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am trying to do something that I think would be simple. I want to insert a link to an xls workbook into a title on a chart generated in GPLOT and output through ODS as a PDF.

I have tried:

ods escapechar="^";
TITLE2 '^S={URL="\\it4\Project_Data\Daily_Detail.xlsx"} To go to the source data Click Here';

This simply displayed the text.

I then tried:

title2 link="\\it4\Project_Data\Daily_Detail.xlsx" "Click here to view table";

With this I get a link but it doesn't work. It is recognized as a link in the PDF. I can hover over it and see the address but the address is showing up as"file:///it4/Project_Data/\Daily_Detail.xlsx", When clicking on it nothing comes up.

What am I missing?

share|improve this question
Define "it doesn't work" for the second one. Doesn't work how? what happens when you click on it? – Joe 2 days ago
What version of SAS? The first method works fine for me (9.3). That's the one I'd recommend. The second method, it attempts to fix your link to a standard link format, which doesn't really work properly; you could fix it yourself (file:\\it4\Project_Data\Daily_Detail.xlsx) perhaps but the former is the 'better' solution. – Joe 2 days ago
I am using 9.4 but I just tried 9.3 and got the same result. The text in the title2 statement just being printed out. Could it be a setting, an environment issue or even adobe reader? Everything that I have read tells me this should work. – Robert Stevens 2 days ago
See if you can run the example I posted in an answer (It's not really an answer but there's no good way to post that otherwise). – Joe 2 days ago
Your code works perfectly. I can even put my filepath in your code and it gives me the link I want. If I comment out all of my GPLOT statements an add your PROC PRINT it works fine in my code. It appears to not want to work with the GPLOT statements. – Robert Stevens 2 days ago
show 3 more comments

2 Answers

up vote 0 down vote accepted

This works on my machine:

ods pdf file="c:\temp\test.pdf";
   ods escapechar="^";
 title "^S={URL='c:\'}PROC PRINT";
 proc print data=sashelp.class;
 run;
 ods pdf close;

I get a PDF that has a blue box around the title, and if I click on the title I get asked if I want to open c:\ .

To use this in GPLOT, you may want to set NOGTITLE to get the title to not appear within the image:

ods pdf file="filename.pdf" nogtitle;

That should cause them to appear as text and then should work similarly.

share|improve this answer

Previously I had:

ods escapechar="^";
TITLE 'Daily Report';
TITLE2 '^S={URL="\\it4\Project_Data\Daily_Detail.xlsx"} For source data Click Here';
options orientation=landscape;
axis1 order=(&mindate to &maxdate by week)
  offset=(3,3)
  label=none
  major=(height=1 width=1)
  minor=(number=6 height=.5 width=1)
  width=1;
PROC GPLOT DATA = Letters_Summary;
BY Category;
PLOT Number_Sent*date_sent=Category / haxis = axis1;
symbol interpol=join l=1 w=3;
WHERE category NE "Miscellaneous"
    AND category NE "Verification";
RUN;

This didn't work. It appears that the label and label2 statements needed to be immediately before the GPLOT. Now I have:

options orientation=landscape;
axis1 order=(&mindate to &maxdate by week)
  offset=(3,3)
  label=none
  major=(height=1 width=1)
  minor=(number=6 height=.5 width=1)
  width=1;
ods escapechar="^";
TITLE 'Daily Report';
TITLE2 '^S={URL="\\it4\Project_Data\Daily_Detail.xlsx"} For source data Click Here';
PROC GPLOT DATA = Letters_Summary;
BY Category;
PLOT Number_Sent*date_sent=Category / haxis = axis1;
symbol interpol=join l=1 w=3;
WHERE category NE "Miscellaneous"
    AND category NE "Verification";
RUN;

Now it works. I am not sure why the options or axis statements would interfere with making the title a link.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.