Problema
Hai aperto una tabella per mostrare un rapporto. La tabella potrebbe essere temporanea o invisibile e si desidera che la tabella si allontani automaticamente quando il report viene chiuso.
Soluzione
Utilizzare il metodo << OnClose per allegare uno script al report. Fai in modo che lo script chiuda la tabella.
// make a 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"
);
// now make sure the formulas have finished evaluating
dt << RunFormulas;
// then clear the flag that says the table has changes that need to be saved
dt << SetDirty( 0 );
// finally, create a platform (or other window) with an OnClose script.
// the try() captures a message that might happen if the table is
// closed, causing the platform to close, causing the table to close...
dt << Bivariate( Y( :y ), X( :x ), <<ONCLOSE></ONCLOSE>
Platform with <<OnClose event attachedPiattaforma con l'evento << OnClose allegato
Discussione
Puoi usare la finestra di casa per rendere visibile la tabella invisibile dei dati. Il << RunFormulas potrebbe essere necessario prima del << SetDirty (0) per assicurarsi che la valutazione della formula in background non segni la tabella sporca, di nuovo. Il "nosave" impedirà anche il prompt della tabella dirty, ma non se l'utente chiude la tabella anziché il report.
Guarda anche
http://www.pega-analytics.co.uk/blog/housekeeping/