Hi All,
I've recently started writing JSL that summarizes some information in a new window using the Table Box() functionality because I want users to be able to select rows to perform the next step a process. Sometimes making an interactive table box can be cumbersome. I've also recently learned that you can take a data table and turn it into an interactive table box-like interface using the Get As Report command, which makes building the interface much easier and faster.
See for example this JSL:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Boston Housing.jmp" );
RptWin = New Window( "Data Table as report",
Outline Box("Data Table as Report",
dt_Rpt = dt << Get as Report();
)
);
The only problem I'm having is how to use the output in the new window like I can with a Table Box.
In the Table Box environment, you can set functions so that it returns the information within that you select and that can be used further down the code. However, the Get As Report command doesn't let you do that. At least I haven't found any examples of how to do it, and the Scripting Index doesn't have much on the Get As Report command.
The following code is an example of how I've built a table box that has a single row selectable at a time.
tb = Table Box(
Number Col Box( "PC Number", Eval List( PC_n ) ),
Number Col Box( "Eigenvalue", Eval List( PC_eigv ), <<Set Format( "Fixed Dec", 6, 6 ) ),
Number Col Box( "Percent", Eval List( PC_per ), <<Set Format( "Fixed Dec", 6, 6 ) ),
Plot Col Box( "",
Eval List( PC_per ),
<<Set Scale( 0, 100, "Percent" ),
<<Lower( PC_cump ),
<<Upper( PC_cump )
),
Number Col Box( "cumulative Percent", Eval List( PC_cump ), <<Set Format( "Fixed Dec", 6, 6 ) ),
<<Set Shade Headings( 1 ),
<<Set Heading Column Borders( 1 ),
<<Set Selectable Rows( 1 ),
<<Set Row Change Function(
Function( {this},
{SelRows},
SelRows = this << Get Selected Rows;
If(
N Items( SelRows ) > 1, Throw( "Too many items selected!\!rOnly one selection possible." ),
N Items( SelRows ) == 1,
SelRows = this << Get Selected Rows;
N_PCs = SelRows[1];
);
)
)
) Is there a way to get have the same kind of functionality when using the Get As Report output?
Thanks for any feedback!,
DS