Clear previously load data from on-demand data table.

I'd like to have a way to flush out all previously load data (loaded via on-demand) so that the data table is completely empty.

The closest I've come is the script below, however; the previously load dataset appears when I try to load a new dataset.  Any assistance would be helpful.  Thanks in advance.

def ClearDataTable(tbl):
    dt = Document.Data.Tables[tbl]
    if dt.RowCount > 0:
        dt.RemoveRows(RowSelection(IndexSet(dt.RowCount,True)))

ClearDataTable("Data Table Nm")

 

(1) Answer

Login