cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
shampton82
Level VII

Data table reports windows

Hey everyone,

Could anyone show me the way with JSL to get all the reports that are open against a data table? What I'm trying to do is be able to click a script button and minimize all the reports that are open for a selected data table.

 

Thanks for any ideas!

 

Steve

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Data table reports windows

I am not aware of a direct way to do this, but the below script seems to work

Names Default To Here( 1 );
dt = Current Data Table();

windowNumbersToMinList = {};
theName = Current Data Table() << get name;

// Loop across all windows and find report windos attached to data table name
// Definition of a report window, is one that starts with the data table name and
// is followed by a "-"
i = 1;
While( Window( i ) << get window title != {},
	theWName = Window( i ) << get window title;
	If( Contains( theWName, theName ) == 1 & Substr( theWName, Length( theName ) + 2, 1 ) == "-",
		Insert Into( windowNumbersToMinList, i )
	);
	i++;
);

// Loop across found windows and minimize them
If( N Items( windowNumbersToMinList ) > 0,
	For( i = N Items( windowNumbersToMinList ), i >= 1, i--,
		Window( windowNumbersToMinList[i] ) << minimize window
	)
);
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Data table reports windows

I am not aware of a direct way to do this, but the below script seems to work

Names Default To Here( 1 );
dt = Current Data Table();

windowNumbersToMinList = {};
theName = Current Data Table() << get name;

// Loop across all windows and find report windos attached to data table name
// Definition of a report window, is one that starts with the data table name and
// is followed by a "-"
i = 1;
While( Window( i ) << get window title != {},
	theWName = Window( i ) << get window title;
	If( Contains( theWName, theName ) == 1 & Substr( theWName, Length( theName ) + 2, 1 ) == "-",
		Insert Into( windowNumbersToMinList, i )
	);
	i++;
);

// Loop across found windows and minimize them
If( N Items( windowNumbersToMinList ) > 0,
	For( i = N Items( windowNumbersToMinList ), i >= 1, i--,
		Window( windowNumbersToMinList[i] ) << minimize window
	)
);
Jim
shampton82
Level VII

Re: Data table reports windows

Works perfect, thanks!

Recommended Articles