<?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 Re: Add ref line in report through application builder script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/237123#M46821</link>
    <description>&lt;P&gt;Hi everyone - i am happy to report that the original issue reported here has been fixed in the latest release of JMP (15). You should no longer need the wait(0) for this to work. For those who are using older versions of JMP, this is a great workaround.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2019 20:22:01 GMT</pubDate>
    <dc:creator>Audrey_Shull</dc:creator>
    <dc:date>2019-12-03T20:22:01Z</dc:date>
    <item>
      <title>Add ref line in report through application builder script</title>
      <link>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52847#M29929</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I was trying to add&amp;nbsp;the following line&amp;nbsp;in my application builder script to add ref lines to reports:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Report1[Axis Box(1)] &amp;lt;&amp;lt; Add Ref Line( 100, "Solid", "Medium Dark Red", "LL", 10 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, it does nothing.&amp;nbsp;I get no warnings or errors in the log. I've checked the display tree and I'm accessing the correct Axis Box. If I change the index of the axis box it does generate an error. I can't see why this shouldn't work. Is this a bug?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Strangely, while fiddling with it I changed something that produced an error on that line, but succesfully added the ref line. One time. Rerunning the same thing did not add the line in the future.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have since changed it to a button you press in the report to add the ref line, which worked on the first try using the same exact script line, so I'm not urgently needing a solution. Just wondering if this is a bug.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Consolas" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 20:40:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52847#M29929</guid>
      <dc:creator>DopeAgonist</dc:creator>
      <dc:date>2018-03-08T20:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Add ref line in report through application builder script</title>
      <link>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52851#M29931</link>
      <description>&lt;P&gt;How is Report1 defined?&amp;nbsp; Is that the name of the module?&lt;/P&gt;&lt;P&gt;Typically, to access unnamed display boxes in an Application Builder module window, you need to get a reference to the window using something like:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Report1 = this module instance &amp;lt;&amp;lt; Get box&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Try replacing the line you have with this to see if that is the problem:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;(this module instance &amp;lt;&amp;lt; get box)[Axis Box(1)] &amp;lt;&amp;lt; Add Ref Line( 100, "Solid", "Medium Dark Red", "LL", 10 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 20:16:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52851#M29931</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-03-08T20:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Add ref line in report through application builder script</title>
      <link>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52856#M29932</link>
      <description>&lt;P&gt;Sorry I didn't provide more context. Report1 is a oneway report allocated in the application builder. The variable does exist.&lt;BR /&gt;&lt;BR /&gt;I was able to access the framebox of the same report to add a legend using:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Report1[FrameBox(1)] &amp;lt;&amp;lt; Row Legend(
Tissue,
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 ));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;So I think the reference is working.&lt;BR /&gt;&lt;BR /&gt;I did try the line you suggested though and it did not produce anything. No errors or warnings, no ref line.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 20:41:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52856#M29932</guid>
      <dc:creator>DopeAgonist</dc:creator>
      <dc:date>2018-03-08T20:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Add ref line in report through application builder script</title>
      <link>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52859#M29934</link>
      <description>&lt;P&gt;Thanks for the clarification.&amp;nbsp;&amp;nbsp;In that case, your code really should work.&amp;nbsp; I did a test case with a oneway report in an app builder app, and that line of code worked perfectly.&amp;nbsp; Maybe it's worth a tech support call?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 20:51:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52859#M29934</guid>
      <dc:creator>cwillden</dc:creator>
      <dc:date>2018-03-08T20:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Add ref line in report through application builder script</title>
      <link>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52872#M29937</link>
      <description>&lt;P&gt;is the goal to add only one reference line, or is the goal to add reference lines dynamically?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2018-03-08 at 5.51.44 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9779i90E80CC767F8F0FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2018-03-08 at 5.51.44 PM.png" alt="Screen Shot 2018-03-08 at 5.51.44 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sometimes I need to add reference lines based on data in a table. In this case, adding this script to customize the graph toes the trick.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//example&lt;BR /&gt;For Each Row(
	If( :ref &amp;gt; 0,
		V Line( Row(), Col Minimum( :weight ) - 10, Col Maximum( :weight ) + 10 )
	)
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In a little more context, this is what it looks like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=open("$Sample_Data\Big Class.jmp");
dt&amp;lt;&amp;lt;	New Column( "ref",
		Set Values(
			[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0]
		)
	);
dt&amp;lt;&amp;lt;New Column( "Row",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( Row() )
	),

dt&amp;lt;&amp;lt;Graph Builder(
	Size( 528, 446 ),
	Show Control Panel( 0 ),
	Variables( X( :Row ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Graph Builder",
			FrameBox,
			{Add Graphics Script(
				2,
				Description( "Script" ),
				For Each Row(
					If( :ref &amp;gt; 0,
						V Line(
							Row(),
							Col Minimum( :weight ) - 10,
							Col Maximum( :weight ) + 10
						)
					)
				)
			), Grid Line Order( 1 ), Reference Line Order( 3 )}
		)
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Mar 2018 22:55:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52872#M29937</guid>
      <dc:creator>Byron_JMP</dc:creator>
      <dc:date>2018-03-08T22:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: Add ref line in report through application builder script</title>
      <link>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52941#M29962</link>
      <description>&lt;P&gt;I also tried this using Big Class as an example, and I may have figured out what is going on.&amp;nbsp; My app is attached and it does work initially.&amp;nbsp; However, if you turn on the Local Data Filter, the line goes away.&amp;nbsp; The LDF works by rerunning the platform, and in this case the reference line customizations are not retained.&amp;nbsp; This happens both inside and outside of App Builder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is that platform scripts (as saved from LIRT &amp;gt; Save Script &amp;gt; To Script Window) only save customizations that have been applied since the initial display of the platform.&amp;nbsp; This is one of the cases where adding the line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Wait(0);&lt;/PRE&gt;
&lt;P&gt;BEFORE the code that accesses the report will allow the platform to display once prior to adding the reference line.&amp;nbsp; In the attached .jmpappsource I have commented out this line, so you can add it back in to test the solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 19:14:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52941#M29962</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2018-03-09T19:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Add ref line in report through application builder script</title>
      <link>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52964#M29969</link>
      <description>&lt;P&gt;Thanks as usual everyone!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dan, can you explain what exactly adding the Wait(0); line does? (i.e. update the displays?)&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 22:42:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52964#M29969</guid>
      <dc:creator>DopeAgonist</dc:creator>
      <dc:date>2018-03-09T22:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Add ref line in report through application builder script</title>
      <link>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52975#M29977</link>
      <description>&lt;P&gt;&lt;SPAN&gt;In this case Wait(0) allows the window to display to the screen, which also sets the "initial state" that determines whether customizations are saved to the script.&amp;nbsp; For performance reasons, some&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;events&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;are processed asynchronously to allow scripts to continue to run.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 11:47:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/52975#M29977</guid>
      <dc:creator>danschikore</dc:creator>
      <dc:date>2018-03-10T11:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Add ref line in report through application builder script</title>
      <link>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/237123#M46821</link>
      <description>&lt;P&gt;Hi everyone - i am happy to report that the original issue reported here has been fixed in the latest release of JMP (15). You should no longer need the wait(0) for this to work. For those who are using older versions of JMP, this is a great workaround.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 20:22:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-ref-line-in-report-through-application-builder-script/m-p/237123#M46821</guid>
      <dc:creator>Audrey_Shull</dc:creator>
      <dc:date>2019-12-03T20:22:01Z</dc:date>
    </item>
  </channel>
</rss>

