重做取消<<报告操作嗨,
如果我在脚本中运行一些报告更改,然后在启用Autorecalc的情况下排除某些行,
所有报告更改都会消失。
如何将所有报告更改插入到分发主体中,以便它们不会消失?
谢谢。
dt = Open(“$ SAMPLE_DATA / Big Class.jmp”);
dist =分布(
自动记录(1),
连续分配(
分位数(0),
摘要统计(1),
专栏(:重量),
水平布局(1),
Ppk能力标签(1),
能力分析(LSL(80),USL(140))
));
PpkValue =(dist << report)[OutlineBox(“长期西格玛”)] [NumberColBox(1)] [2];
PPKtb =表盒(
String Col Box(“参数”,{“Ppk”}),
数字Col Box(“Value”,{PpkValue})
);
(dist << report)[OutlineBox(“Summary Statistics”)] << Append(PPKtb);
(dist <<报告)[OutlineBox(“长期西格玛”)] <<删除;
Re:重做取消<<报告动作我相信,你的语法有点偏。 将引用更改为以下,它可以正常工作
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dist = Distribution(
Automatic Recalc( 1 ),
Continuous Distribution(
Quantiles( 0 ),
Summary Statistics( 1 ),
Column( :weight ),
Horizontal Layout( 1 ),
Ppk Capability Labeling( 1 ),
Capability Analysis( LSL( 80 ), USL( 140 ) )
)
);
PpkValue = (dist << report)[Outline Box( "Long Term Sigma" )][Number Col Box( 1 )][2];
PPKtb = Table Box( String Col Box( "Parameter", {"Ppk"} ), Number Col Box( "Value", {PpkValue} ) );
(dist << report)["Summary Statistics"] << Append( PPKtb );
(dist << report)["Long Term Sigma"] << delete;Re:重做取消<<报告动作谢谢。
它确实工作正常,但当我排除一行时,所有报告更改都会消失。
你是什么意思“改变对以下的引用”?
请参见附图。
Re:重做取消<<报告动作当您执行Recalc时,平台会被有效地重新运行,因此您的所有后期修改也需要重新运行。 一种方法是使用过滤器更改处理程序或行状态处理程序,当检测到过滤器或行状态的更改时,它将运行代码。 您还可以将图形脚本添加到分发图形中的Frame Box(),以在图形更改时触发代码的执行。 下面的代码使用Make Filter Change Handler()来完成工作
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dist = Distribution(
Automatic Recalc( 1 ),
Continuous Distribution(
Quantiles( 0 ),
Summary Statistics( 1 ),
Column( :weight ),
Horizontal Layout( 1 ),
Ppk Capability Labeling( 1 ),
Capability Analysis( LSL( 80 ), USL( 140 ) )
)
);
addit = Function({},
PpkValue = (dist << report)["Long Term Sigma"][Number Col Box( 1 )][2];
PPKtb = Table Box( String Col Box( "Parameter", {"Ppk"} ), Number Col Box( "Value", {PpkValue} ) );
(dist << report)["Summary Statistics"] << Append( PPKtb );
(dist << report)["Long Term Sigma"] << delete;);
filter = dist << Local Data Filter(
Add Filter( columns( :age ) )
);
f = Function( {a}, addit() );
rs = filter << Make Filter Change Handler( f );
addit();
Re:重做取消<<报告动作谢谢吉姆。
不幸的是,这个解决方案对我不利。
1。我不想添加本地数据过滤器
2。当我运行您的脚本并更改本地数据过滤器中的选择时,分发重新运行而不自定义报告更改。
你的第二个解决方案的语法是什么( 框架的图形脚本() )?
再次感谢。
Re:重做取消<<报告动作谢谢!
“添加图形脚本”对我来说很好用!Re:重做取消<<报告动作我的脚本旨在为您提供可以使用的可能方法的指针,希望它可以提供足够的见识。 我希望我可以通过以下几点改进自己的输入:
我之前的回答中没有提到2种方法。 我提到了3种方法,“过滤器更改处理程序”,“行状态处理程序”和“添加图形脚本”。 给定所需的详细信息,您可以选择使用任何一个不同的选项。 我在下面提供了2个脚本,一个使用RowState处理程序,另一个使用添加图形脚本。
RowState处理程序与“筛选器更改处理程序”的实现非常相似。 使用它,如果对数据表中的RowState列进行了任何更改,则将触发更改。
names default to here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dist = Distribution(
Automatic Recalc( 1 ),
Continuous Distribution(
Quantiles( 0 ),
Summary Statistics( 1 ),
Column( :weight ),
Horizontal Layout( 1 ),
Ppk Capability Labeling( 1 ),
Capability Analysis( LSL( 80 ), USL( 140 ) )
)
);
addit = Function({},
PpkValue = (dist << report)["Long Term Sigma"][Number Col Box( 1 )][2];
PPKtb = Table Box( String Col Box( "Parameter", {"Ppk"} ), Number Col Box( "Value", {PpkValue} ) );
(dist << report)["Summary Statistics"] << Append( PPKtb );
(dist << report)["Long Term Sigma"] << delete;);
f = Function( {a}, addit() );
rs = dt << Make RowState Handler( f );
addit();
添加图形示例更加复杂。 这主要是因为脚本编写者必须确定需要比较哪些项目才能触发代码运行。 在以下情况下,检查均值或标准差是否发生更改将触发代码运行。 对于您的用户可能正在更改的事物而言,这可能还不够……因此需要进行扩展或完全更改。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dist = Distribution(
Automatic Recalc( 1 ),
Continuous Distribution(
Quantiles( 0 ),
Summary Statistics( 1 ),
Column( :weight ),
Horizontal Layout( 1 ),
Ppk Capability Labeling( 1 ),
Capability Analysis( LSL( 80 ), USL( 140 ) )
)
);
addit = Function( {},
PpkValue = (dist << report)["Long Term Sigma"][Number Col Box( 1 )][2];
PPKtb = Table Box( String Col Box( "Parameter", {"Ppk"} ), Number Col Box( "Value", {PpkValue} ) );
(dist << report)["Summary Statistics"] << Append( PPKtb );
(dist << report)["Long Term Sigma"] << delete;
);
theMean = ((dist << report)["Summary Statistics"][Number Col Box( 1 )] << get)[1];
theSTD = ((dist << report)["Summary Statistics"][Number Col Box( 1 )] << get)[2];
(dist << report)[framebox( 2 )] << add graphics script(
If(
theMean != ((dist << report)["Summary Statistics"][Number Col Box( 1 )] << get)[1] | theSTD != ((dist
<< report)["Summary Statistics"][Number Col Box( 1 )] << get)[2],
addit()
);
theMean = ((dist << report)["Summary Statistics"][Number Col Box( 1 )] << get)[1];
theSTD = ((dist << report)["Summary Statistics"][Number Col Box( 1 )] << get)[2];
);
addit();
我强烈建议您花些时间阅读《脚本指南》,并熟悉脚本索引。 Scripting Guide中的JSL概述提供了成为一名熟练的JSL程序员所需要的基础,并且Scripting Index中所有对象和函数的示例对于编写代码都非常宝贵。