Dear community,
I hope you can help with this. The example script below creates a table and opens the profiler platform. Additionally it appends two controls to the report. The functionality of the ‘Turn On’ button is to set the value of the Check Box to 1/true. The controls are added by using a reference to the profiler report, ‘PF’. Now, the problem arises when running the script twice in a row. By doing this, the ‘PF’ reference will be overwritten to refer to the newest report. When I use the ‘Turn On’ button on the old report, it now sets the value of the Check Box in the new report. Of course, this is not the behavior I want. I guess I must somehow use a unique reference for every report. Can anyone help? Thank you.
Table 1 = New Table( "Table 1",
Add Rows( 1 ),
New Column( "p1", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [2] ) ),
New Column( "p2", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [3] ) ),
New Column( "model",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( :p1 ^ 2 + :p2 ^ 2 ),
Set Selected
),
Set Row States( [1] )
);
PF = Profiler(
Y( :model ),
Profiler(
1,
Term Value(
p1( 2, Min( 1.9 ), Max( 2.1 ), Lock( 0 ), Show( 1 ) ),
p2( 3, Min( 2.9 ), Max( 3.1 ), Lock( 0 ), Show( 1 ) )
)
)
);
Report( PF )["Prediction Profiler"] << Append(
NewButton = Button Box( "Turn On" );
//NewIndicator = Radio Box();
);
Report( PF )["Prediction Profiler"] << Append( CheckBox = Check Box( "Item 1" ) );
Report( PF )[Button Box( 1 )] << Set Script(
CheckBox << Set( 1 )
);