Create a function to generate a data table with buttons:
Define Function( Create_Data_Table_With_Buttons( dt_name, window_title ),
dt_Rpt = dt_name << Get as Report();
tb = dt_Rpt[Table Box( 1 )];
tb << append(
bb = col box("Pull Alarms")
);
bblist = {};
for (i = 1, i <= N Rows(dt_name), i++,
bb_expr = evalinsert("\[bblist[i] = buttonbox("Pull Alarms",
tb << Set Selected Rows(Matrix({^i^}));
dt = Get Data Table( "^window_title^ Alarms for rows " || char(^i^));
dt << ShowWindow( 1 );
dt << Bring Window To Front;
)]\");
eval(parse(bb_expr));
bb << append(bblist[i]);
);
return dt_Rpt;
);
Create a list of data table names and their corresponding window titles:
data_table_info = {
{"dt_1", "Down Time Exceeding 5mins"},
{"dt_2", "Another Data Table1"},
{"dt_3", "Another Data Table2"}
};
Use a loop to create multiple OutLine boxes with data tables and buttons:
data_window = New Window("Multiple Data Tables",
<< Size Window( 1000, 600 ),
H List Box(
V List Box(
for(i = 1, i <= N Items(data_table_info), i++,
OutLine Box(data_table_info[i][2],
Create_Data_Table_With_Buttons(
Eval(data_table_info[i][1]),
data_table_info[i][2]
)
)
)
)
)
);
Hope that helps.