探索峰會演講一個多選項卡、可過濾的儀表板提供了一個通用腳本來生成多選項卡儀表板。我正在使用此腳本的副本(如下所示)將一系列儀表板合併到一個多選項卡儀表板中。 但是,該腳本將所有儀表板分開,然後以 1 x 1 或 2 x 2 的方式再次組合它們。 因此,具有兩個圖表(一個在另一個之上)的原始儀表板將轉換為兩個圖表並排的儀表板。
我的儀表板基於多個不同的數據表,因此,如果我僅在同一儀表板中使用單獨的選項卡,則很難從每個表中獲得本地數據過濾器。
我需要的是一個腳本,它可以獲取所有打開的儀表板並將它們組合起來,而不改變儀表板的設置。 關於如何更改以下腳本或從頭開始有什麼建議嗎?
///////////////////////////////// Create Tabbed Dashboard //////////////////////////////////////////////////
wait( 2 );
dashes = Find All(Reports);
tb = Expr(Tab Box());
For(i = 1, i<= N Items(dashes), i ++,
tabPage = Expr(Tab Page Box());
dfcb = Expr(Data Filter Context Box());
lub = Expr(Line Up Box(N Col(2)));
hlb = Expr(H List Box());
//Get Data table name to use with the data filter
wintitle = dashes[i] << Get Window Title;
wordone = Word(1, wintitle, "-");
wordtwo = Word(2, wintitle, "-");
dtname = Substr(wordone, 1, Length(wordone)-1 );
dt = Eval Expr(Data Table(Expr(dtName)));
//Get dashboard name
dashName = Substr(wordtwo, 2);
failed = 0;
j = 1;
//Loop through the tab page boxes in the dashboard, and extract the scripts
While(failed ==0,
Try(tpb = dashes[i] << Find(TabPageBox(j)),
failed = 1; Continue();
);
//Try to get the script from the display box if it exisits
Try(obj = tpb << Get Scriptable Object;
script = obj << Get Script,
j ++; Continue();
);
//If the script is for the local data filter add the script to the H List Box
If(Char(Head(Name Expr(script))) == "Data Filter",
FilterExprStr = char(NameExpr(dt)) || " << " || char(Name Expr(script));
FilterExpr = Parse(FilterExprStr);
Insert Into(hlb,NameExpr(FilterExpr));
,
//Else add it to the lineup box
If( Char(Name Expr(script)) != "Scriptable[]",
reportExprStr = char(NameExpr(dt)) || " << " || char(Name Expr(script));
reportExpr = Parse(reportExprStr);
scrollbox = Expr(Scroll Box());
Insert Into(scrollbox, Name Expr(reportExpr));
Insert Into(lub,Name Expr(scrollbox));
);
);
j ++;
);
//Build up the display boxes
Insert Into(hlb, Name Expr(lub));
Insert Into(dfcb, Name Expr(hlb));
Insert Into(tabPage, Eval Expr(Title(Expr(dashName))), 1);
Insert Into(tabPage, Name Expr(dfcb), 2);
Insert Into(tb, Name Expr(tabPage));
);
//Create combined dashboard window
New Window("Combined Dashboard", tb);
//Close all the individual dash reports
For( w = 1, w <= N Items(dashes), w ++,
dashes[w] << Close Window;
);