This code adds a small menu to any Data Filter - select your columns and click OK to cycle through the entries and auto-save the GraphBuilder plot.
(columns with continuous values are not listed)
Names Default to HERE(1);
if(not(namespaceExists("autoAnimate")),New NameSpace("autoAnimate"));
autoAnimate:update = function({},
Try (autoAnimate:DFTopLB = Current Report()["Local Data Filter", List Box( 1 )], stop());
Try(autoAnimate:myDFTPBs = (Current Report()["Local Data Filter", Lineup Ruler Box( 1 ), List Box( 1 )] << Xpath( "//TabPageBox" )),stop());
// collect Data Fitlers with ListBoxes, remove the continuos ones.
autoAnimate:myDFLBs ={};
For Each ( {TPB,i}, autoAnimate:myDFTPBs, tmp=(TPB << xpath( "//ListBoxBox" ));If(NItems(tmp),Insert Into(autoAnimate:myDFLBs,tmp[1]),Remove from(autoAnimate:myDFTPBs,i) ));
// which columns are used?
autoAnimate:DFCols = Transform Each( {TPB}, autoAnimate:myDFTPBs, Trim( Word( 1, TPB << Get Title, "(" ) ) );
// what are the entries? (for the filename)
autoAnimate:myDFLBItems = autoAnimate:myDFLBs << get items;
// how many entries?
autoAnimate:myDFLBNItems = Transform Each( {items}, autoAnimate:myDFLBItems, N Items( items ) );
// variales for the for loops
chars = {"aa", "bb", "cc", "dd", "ee", "ff", "gg", "hh", "ii"};
// append a Display Box:
Try(autoAnimate:animatePane << delete);
autoAnimate:DFTopLB << append( autoAnimate:animatePane = V List Box (Spacer Box( size( 0, 20 ) ),Panel Box( "cycle selected + save", V List Box( colSelection = List Box( autoAnimate:DFCols ), H List Box( Button Box("update",autoAnimate:update()),Spacer Box (size(40,0)),Button Box( "start", autoAnimate:animateNsave() ) )) ) ));
);
autoAnimate:animateNsave = Function( {},
// which DFs are selected?
selectedCols = colselection << Get Selected Indices;
// compose the expression
expression = "";
xx=1;
// for loop for every active DF:
For( i = 1, i <= N Items( autoAnimate:myDFTPBs ), i++,
expression = expression || If( Contains( selectedCols, i ),
"For(" || chars[i] || "=1," || chars[i] || "<=" || Char( autoAnimate:myDFLBNItems[i] ) || "," || chars[i] || "++,__LB" || Char( i ) ||
"__ << clear selection << set selected(" || chars[i] || ");",
"if(1,"
)
);
// save current Graph builder Plot -- how about other reports?
expression = expression || "wait();(current report()<< XPath(\!"//OutlineBox[@helpKey='Graph Builder']\!"))<<Save Picture(\!"C:\temp\\!"";
// compose the correct filename
For( i = 1, i <= N Items( autoAnimate:myDFTPBs ), i++, expression = expression ||If( Contains( selectedCols, i ), "||\!""||Char (autoAnimate:DFCols[i])||"=\!"||Char("||Char(autoAnimate:myDFLBItems[i])||"["||chars[i]||"])||\!"_\!"","||\!"_\!""));
expression = expression || "||\!".png\!")";
For( i = 1, i <= N Items( autoAnimate:myDFTPBs ), i++,
expression = expression || ")"
);
expression = Parse(expression);
For( i = 1, i <= N Items( autoAnimate:myDFTPBs ),i++,expression = Substitute(Name Expr(expression ),Parse("__LB"|| Char( i ) ||"__"),autoAnimate:myDFLBs[i]));
//Name Expr(expression )
Eval(expression);
Open("C:\temp");
);
autoAnimate:update();