Hi guys,
I am trying to write a script to apply column switcher to all open reports. Please guide me
dt = Current data Table();
//Get all Open reports
wList = Get Window List( Type( "Reports" ) );
//Get Column to replace and column to replace with
win = New Window( "Set a Value",
<<Modal,
<<Return Result,
H List Box(
ColumnSwitcherObject = dt << Column Switcher(),
colList = dt << Col List Box()
),
Button Box( "OK" ),
Button Box( "Cancel" )
);
//Now i want to loop through all reports and check if data table matches then replace column with selected column
If( win["Button"] == 1,
wList = Get Window List( Type( "Reports" ) );
for(i=1,i <= nitems(wList),i++,
curWin = wList[i][Outline Box( 1 )][Outline Box( 1 )];
curWinObj = curWin << get scriptable object;
curWinDt = curWinObj << Get Datatable;
if (curWinDt == dt )
{
//Replace all istance of column in list box of widow and col switcher
}
)Please guide how to do this action.
Thanks in advance