Hello Everybody,
I have an issue regarding sorting of a table. I wanted to sort table by Date (located in Date1 column) and I am doing that after certain condition is met. However, it does not sort and replace the table EL_summary after sorting. Is there any refreshing necessary? I put also some delay, I thought one need to wait some time. When I am not using replace table(1), the new Table under different name is created and opened (what I don't want) and again data in this table is not sorted. After that, however, data in EL_summary seems to be updated and sorted. I would appreciate for pointing what I am missing. Best regards
Current Data Table( EL_summary );
if( N rows(EL_summary) > 0, EL_summary << sort(by(:name("Date1")), Order( Ascending ), replace table(1)));
wait(1);
One option:
Works great thanks :)
closeMyReports = Function( {dt},
{default local},
AllmyReports = {};
myReports = Get Window List( Type( "Reports" ) );
For Each( {rep}, myReports,
Try(
myList = (rep << Xpath( "//OutlineBox" )) << get scriptable Object();
myDTs = Transform Each( {scriptableObject}, myList, If( Is Empty( scriptableObject ), ., scriptableObject << Get Data Table() ) );
If( Contains( myDTs, dt ),
Insert Into( AllmyReports, rep )
);
)
);
If( N Items( AllmyReports ) > 0,
If(
ex = New Window( "",
<<Type( "Modal Dialog" ),
<<Return Result,
V List Box( Text Box( "open reports detected.\!nOK to close them?" ), H List Box( Button Box( "OK" ), Button Box( "Cancel" ) ) )
);
ex["button"] == 1;
,
AllmyReports << close window(),
Stop()
)
);
);
dt = current data table();
closeMyReports(dt)
edit: now the script also checks for more complicated reports with many data tables.
Next step: is there a command:
dt << get linked subsets()