Problem
You've opened a table to show a report. The table might be temporary or invisible, and you want the table to go away silently when the report is closed.
Solution
Use the <<OnClose method to attach a script to the report. Make the script close the table.
dt = New Table( "Temporary",
Add Rows( 1e6 ),
New Column( "x", Formula( Random Normal( 50, 30 ) ) ),
New Column( "y", Formula( Random Normal( 50, 30 ) ) ),
"Invisible"
);
dt << RunFormulas;
dt << SetDirty( 0 );
dt << Bivariate( Y( :y ), X( :x ), <<OnClose( Try( Close( dt, "nosave" ) ) ) );
Platform with <<OnClose event attached
Discussion
You can use the home window to make the invisible data table visible. The <<RunFormulas might be needed before the <<SetDirty(0) to make sure the background formula evaluation doesn't mark the table dirty, again. The "nosave" will prevent the prompt for the dirty table also, but not if the user closes the table instead of the report.
See Also
http://www.pega-analytics.co.uk/blog/housekeeping/