<?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 scriptable object of the current report in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/scriptable-object-of-the-current-report/m-p/821280#M100035</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what is the best way to get the scriptable object of the current report?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it's a Graph Builder Object, I can use&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gb = Current Report()["Graph Builder"] &amp;lt;&amp;lt; get scriptable object &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is astonishingly robust - but just works for Graph Builder objects. It even works when the user changed the title.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it no Graph Builder, I can try&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;so = Current Report()[Outline Box( 1 )] &amp;lt;&amp;lt; get scriptable object&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It will work if there is no &lt;FONT face="courier new,courier"&gt;Local Data Filter&lt;/FONT&gt;,&lt;BR /&gt;&lt;STRIKE&gt;no &lt;FONT face="courier new,courier"&gt;Column Switcher&lt;/FONT&gt;&lt;/STRIKE&gt;&amp;nbsp;[ah, Column Switcher is a &lt;FONT face="courier new,courier"&gt;ColumnSwitcherContextOutlineBox&lt;/FONT&gt;, no &lt;FONT face="courier new,courier"&gt;OutlineBox&lt;/FONT&gt;]&lt;BR /&gt;&lt;STRIKE&gt;and no user define Dashboard&lt;/STRIKE&gt; [ah, the Dashboard is created via &lt;FONT face="courier new,courier"&gt;TabPageBox&lt;/FONT&gt;es, not &lt;FONT face="courier new,courier"&gt;OutlineBox&lt;/FONT&gt;es]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the case with the &lt;FONT face="courier new,courier"&gt;Local Data Filter&lt;/FONT&gt;, I could check the title:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ob = Current Report()[Outline Box( 1 )];
If( (ob &amp;lt;&amp;lt; Get Title) == "Local Data Filter",
	ob = Current Report()[Outline Box( 2 )]
);&lt;BR /&gt;ob&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;get&amp;nbsp;scriptable&amp;nbsp;object;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This approach works only with English language setting and just if the user didn't change the title of the &lt;FONT face="courier new,courier"&gt;OutlineBox&lt;/FONT&gt;.&lt;BR /&gt;&lt;BR /&gt;So, better check if the scriptable object if it is a data filter:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Try (so = Current Report()[Outline Box( 1 )] &amp;lt;&amp;lt; get scriptable object;
if (Char(Head(so)) == "Data Filter[]" ,
so = Current Report()[Outline Box( 2 )] &amp;lt;&amp;lt; Get Scriptable Object),
	Caption("failed to get a scriptable object") // user defined Dashboard
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Dec 2024 11:40:35 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2024-12-09T11:40:35Z</dc:date>
    <item>
      <title>scriptable object of the current report</title>
      <link>https://community.jmp.com/t5/Discussions/scriptable-object-of-the-current-report/m-p/821280#M100035</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what is the best way to get the scriptable object of the current report?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it's a Graph Builder Object, I can use&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gb = Current Report()["Graph Builder"] &amp;lt;&amp;lt; get scriptable object &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This is astonishingly robust - but just works for Graph Builder objects. It even works when the user changed the title.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it no Graph Builder, I can try&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;so = Current Report()[Outline Box( 1 )] &amp;lt;&amp;lt; get scriptable object&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It will work if there is no &lt;FONT face="courier new,courier"&gt;Local Data Filter&lt;/FONT&gt;,&lt;BR /&gt;&lt;STRIKE&gt;no &lt;FONT face="courier new,courier"&gt;Column Switcher&lt;/FONT&gt;&lt;/STRIKE&gt;&amp;nbsp;[ah, Column Switcher is a &lt;FONT face="courier new,courier"&gt;ColumnSwitcherContextOutlineBox&lt;/FONT&gt;, no &lt;FONT face="courier new,courier"&gt;OutlineBox&lt;/FONT&gt;]&lt;BR /&gt;&lt;STRIKE&gt;and no user define Dashboard&lt;/STRIKE&gt; [ah, the Dashboard is created via &lt;FONT face="courier new,courier"&gt;TabPageBox&lt;/FONT&gt;es, not &lt;FONT face="courier new,courier"&gt;OutlineBox&lt;/FONT&gt;es]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the case with the &lt;FONT face="courier new,courier"&gt;Local Data Filter&lt;/FONT&gt;, I could check the title:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ob = Current Report()[Outline Box( 1 )];
If( (ob &amp;lt;&amp;lt; Get Title) == "Local Data Filter",
	ob = Current Report()[Outline Box( 2 )]
);&lt;BR /&gt;ob&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;get&amp;nbsp;scriptable&amp;nbsp;object;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This approach works only with English language setting and just if the user didn't change the title of the &lt;FONT face="courier new,courier"&gt;OutlineBox&lt;/FONT&gt;.&lt;BR /&gt;&lt;BR /&gt;So, better check if the scriptable object if it is a data filter:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Try (so = Current Report()[Outline Box( 1 )] &amp;lt;&amp;lt; get scriptable object;
if (Char(Head(so)) == "Data Filter[]" ,
so = Current Report()[Outline Box( 2 )] &amp;lt;&amp;lt; Get Scriptable Object),
	Caption("failed to get a scriptable object") // user defined Dashboard
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 11:40:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/scriptable-object-of-the-current-report/m-p/821280#M100035</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-09T11:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: scriptable object of the current report</title>
      <link>https://community.jmp.com/t5/Discussions/scriptable-object-of-the-current-report/m-p/821305#M100038</link>
      <description>&lt;P&gt;Use "@helpKey" XML attribute&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

obs = Current Report() &amp;lt;&amp;lt; XPath("//OutlineBox[@helpKey and not(@helpKey = 'Data Filter')]");
If(N Items(obs) &amp;gt; 0,
	obj = obs[1] &amp;lt;&amp;lt; Get Scriptable Object;
	Show(obj);
);

Write();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;XPath query might need additional modifications depending on where it has to work. Do note that with XPath you can run into issues where JMP's XPath query isn't able to handle the XML(&lt;LI-MESSAGE title="How to enable XML_PARSE_HUGE for &amp;amp;lt;&amp;amp;lt; XPath()?" uid="748558" url="https://community.jmp.com/t5/Discussions/How-to-enable-XML-PARSE-HUGE-for-lt-lt-XPath/m-p/748558#U748558" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;).&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 09:44:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/scriptable-object-of-the-current-report/m-p/821305#M100038</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-12-09T09:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: scriptable object of the current report</title>
      <link>https://community.jmp.com/t5/Discussions/scriptable-object-of-the-current-report/m-p/821308#M100039</link>
      <description>&lt;P&gt;Ah, nice. Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 09:57:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/scriptable-object-of-the-current-report/m-p/821308#M100039</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-09T09:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: scriptable object of the current report</title>
      <link>https://community.jmp.com/t5/Discussions/scriptable-object-of-the-current-report/m-p/821319#M100041</link>
      <description>&lt;P&gt;The whole issue can become moot if rather than using&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Distribution(
	Continuous Distribution( Column( :height ), Process Capability( 0 ) ),
	Local Data Filter
);
ob = Current Report()[Outline Box( 1 )];
If( (so &amp;lt;&amp;lt; Get Title) == "Local Data Filter",
	ob = Current Report()[Outline Box( 2 )]
);
ob &amp;lt;&amp;lt; get scriptable object;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the scriptable object is obtained when the platform is executed&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ob = Distribution(
	Continuous Distribution( Column( :height ), Process Capability( 0 ) ),
	Local Data Filter
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Even if the multiple platforms are run, and the scriptable object is referenced using the same JSL variable, a simple JMP list can be used to gather in the scriptable object, avoiding all of the confusion that Current Report() can bring.&lt;/P&gt;
&lt;P&gt;Using sample data table Big Class the following script illustrates how obtaining the scriptable object at the point of execution bypasses the Current Report() issue&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=current data table();
objectList = {};

dis = Distribution(
	Continuous Distribution( Column( :height ), Process Capability( 0 ) )
);
insert into(objectList, dis);

show(current report()[outlinebox(1)]&amp;lt;&amp;lt;get title);
ob = report(dis) &amp;lt;&amp;lt; get scriptable object;
show(report(dis)&amp;lt;&amp;lt;get title);
show(report(dis)[outlinebox(1)]&amp;lt;&amp;lt;get title);

dis = Distribution(
	Continuous Distribution( Column( :height ), Process Capability( 0 ) ),
	Local Data Filter
);
insert into(objectList, dis);

show(current report()[outlinebox(1)]&amp;lt;&amp;lt;get title);
ob = report(dis) &amp;lt;&amp;lt; get scriptable object;
show(report(dis)&amp;lt;&amp;lt;get title);
show(report(dis)[outlinebox(1)]&amp;lt;&amp;lt;get title);

show(report(objectList[1])&amp;lt;&amp;lt;get title, report(objectList[2])&amp;lt;&amp;lt;get title)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A Wish List item for a new function called&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;lt;&amp;lt; Get Current Report Scriptable Object&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;might be warrented&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 10:31:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/scriptable-object-of-the-current-report/m-p/821319#M100041</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2024-12-09T10:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: scriptable object of the current report</title>
      <link>https://community.jmp.com/t5/Discussions/scriptable-object-of-the-current-report/m-p/821328#M100042</link>
      <description>&lt;P&gt;my main application:&lt;BR /&gt;A command to tune/interact with any "existing" report .&lt;BR /&gt;So, there is no chance to fill a list.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;A Wish List item for a new function called&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;lt;&amp;lt; Get Current Report Scriptable Object&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;might be warrented&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;ok:&lt;BR /&gt;&lt;LI-MESSAGE title="message: Get Current Report Scriptable Object" uid="821322" url="https://community.jmp.com/t5/JMP-Wish-List/message-Get-Current-Report-Scriptable-Object/m-p/821322#U821322" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;ob&lt;/FONT&gt; &amp;amp; &lt;FONT face="courier new,courier"&gt;so&lt;/FONT&gt; -&amp;gt; corrected in the main post&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 11:42:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/scriptable-object-of-the-current-report/m-p/821328#M100042</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-09T11:42:18Z</dc:date>
    </item>
  </channel>
</rss>

