<?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 Controlling target frame of link generatee by proc sgplot in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Controlling-target-frame-of-link-generatee-by-proc-sgplot/m-p/566826#M5900</link>
    <description>&lt;P&gt;I am using a stored process with streaming output on SAS9.4 M2&amp;nbsp;to generate a html page containing a chart.&amp;nbsp; I want to make the chart title clickable to enable a further stored process to be run and it's resulting html rendered.&amp;nbsp; To do this I have used an annotation dataset to add a link to the output of proc sgplot and positioned it at the tope where the chart title might normally be drawn.&amp;nbsp; The problem I have is that every time the link is clicked the results open in a new tab, whereas I want them to replace the page in my existing tab.&amp;nbsp; It seems to me that proc sgplot is adding target=_Blank to the link its generating and I want to use target=_self, is there a way to control this that I've missed?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The stored process looks&amp;nbsp;like so&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
*processbody;



%symdel _program;

 

%macro mplot_chart(lprefix=);

 

/*This chart annotation functions as a clickable link*/

data &amp;amp;lprefix._annotation;

length function $ 8 url $ 255 anchor $ 5;

 function="text";

 label="&amp;amp;lprefix Chart Title";

 url=cats("&amp;amp;_THISSESSION",'&amp;amp;_PROGRAM','=%2FMyMetadatafolder%2Fshowdetails&amp;amp;inprefix=',

"&amp;amp;lprefix");

 textstyleelement="GraphTitleText";

 textcolor="blue";

 width=100;

 anchor="top";

 y1=100;

 drawspace="GraphPercent";

 

output;

run;

　

/*Create the plot*/

proc sgplot data=save.&amp;amp;lprefix._plotdata

 sganno=&amp;amp;lprefix._annotation pad=(top=25px);

 

series x=utcdatetime y=var1;

series x=utcdatetime y=var2 / lineattrs=(color=red);

run;



%mend mplot_chart;

 

ods graphics on / imagemap=on;

ods graphics / width=3.5in height=2.5in;

ods layout gridded columns=4 advance=table;

title;

 

%mplot_chart(lprefix=Location1);

%mplot_chart(lprefix=Location2);



 

title;

ods layout end;

ods graphics / reset;

 

/*ods html text="&amp;lt;/div&amp;gt;";*/

%stpend;


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Jun 2019 12:10:04 GMT</pubDate>
    <dc:creator>GeorgeT</dc:creator>
    <dc:date>2019-06-18T12:10:04Z</dc:date>
    <item>
      <title>Controlling target frame of link generatee by proc sgplot</title>
      <link>https://communities.sas.com/t5/Developers/Controlling-target-frame-of-link-generatee-by-proc-sgplot/m-p/566826#M5900</link>
      <description>&lt;P&gt;I am using a stored process with streaming output on SAS9.4 M2&amp;nbsp;to generate a html page containing a chart.&amp;nbsp; I want to make the chart title clickable to enable a further stored process to be run and it's resulting html rendered.&amp;nbsp; To do this I have used an annotation dataset to add a link to the output of proc sgplot and positioned it at the tope where the chart title might normally be drawn.&amp;nbsp; The problem I have is that every time the link is clicked the results open in a new tab, whereas I want them to replace the page in my existing tab.&amp;nbsp; It seems to me that proc sgplot is adding target=_Blank to the link its generating and I want to use target=_self, is there a way to control this that I've missed?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The stored process looks&amp;nbsp;like so&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
*processbody;



%symdel _program;

 

%macro mplot_chart(lprefix=);

 

/*This chart annotation functions as a clickable link*/

data &amp;amp;lprefix._annotation;

length function $ 8 url $ 255 anchor $ 5;

 function="text";

 label="&amp;amp;lprefix Chart Title";

 url=cats("&amp;amp;_THISSESSION",'&amp;amp;_PROGRAM','=%2FMyMetadatafolder%2Fshowdetails&amp;amp;inprefix=',

"&amp;amp;lprefix");

 textstyleelement="GraphTitleText";

 textcolor="blue";

 width=100;

 anchor="top";

 y1=100;

 drawspace="GraphPercent";

 

output;

run;

　

/*Create the plot*/

proc sgplot data=save.&amp;amp;lprefix._plotdata

 sganno=&amp;amp;lprefix._annotation pad=(top=25px);

 

series x=utcdatetime y=var1;

series x=utcdatetime y=var2 / lineattrs=(color=red);

run;



%mend mplot_chart;

 

ods graphics on / imagemap=on;

ods graphics / width=3.5in height=2.5in;

ods layout gridded columns=4 advance=table;

title;

 

%mplot_chart(lprefix=Location1);

%mplot_chart(lprefix=Location2);



 

title;

ods layout end;

ods graphics / reset;

 

/*ods html text="&amp;lt;/div&amp;gt;";*/

%stpend;


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 12:10:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Controlling-target-frame-of-link-generatee-by-proc-sgplot/m-p/566826#M5900</guid>
      <dc:creator>GeorgeT</dc:creator>
      <dc:date>2019-06-18T12:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Controlling target frame of link generatee by proc sgplot</title>
      <link>https://communities.sas.com/t5/Developers/Controlling-target-frame-of-link-generatee-by-proc-sgplot/m-p/567470#M5901</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;This is an ODS Graphics issue, not a stored process issue.&amp;nbsp; You can reproduce the problem outside of a stored process by submitting this code:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;The image map created looks like this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.sgplot_anno;
function         = 'text';
label            = 'Chart Title';
url              = 'https://www.sas.com';
textstyleelement = 'GraphTitleText';
textcolor        = 'blue';
width            = 100;
anchor           = 'top';
y1               = 100;
drawspace        = 'GraphPercent';
run;

ods graphics on / imagemap=on drilltarget='_self';

ods graphics / width=3.5in height=2.5in;

title;

ods _all_ close;

ods html path='C:\temp' file='temp.htm' style=HTMLBlue;

proc sgplot data=sashelp.class sganno=work.sgplot_anno pad=(top=25px);
  vbar age;
run; quit;

ods html close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;Area shape="poly" href="&lt;A href="https://www.sas.com" target="_blank" rel="noopener"&gt;https://www.sas.com&lt;/A&gt;" &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;target="_BLANK"&lt;/STRONG&gt;&lt;/FONT&gt; coords="135.5,0.0,200.5,0.0,200.5,19.40625,135.5,19.40625,135.5,0.0,135.5,0.0"/&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;The solution is to add the DRILLTARGET option to your ODS GRAPHICS statement:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics on / imagemap=on drilltarget='_self';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;The image map created now looks like this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;&lt;FONT face="courier new,courier"&gt;&amp;lt;Area shape="poly" href="&lt;A href="https://www.sas.com" target="_blank" rel="noopener"&gt;https://www.sas.com&lt;/A&gt;" &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;target="_self"&lt;/STRONG&gt;&lt;/FONT&gt; coords="135.5,0.0,200.5,0.0,200.5,19.40625,135.5,19.40625,135.5,0.0,135.5,0.0"/&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 22:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Controlling-target-frame-of-link-generatee-by-proc-sgplot/m-p/567470#M5901</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2019-06-19T22:11:52Z</dc:date>
    </item>
  </channel>
</rss>

