Can we use the "Helpkey" at the top of the tree structure for many reports?<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />The question is about an item that appears at the top of the tree structure for a report. i.e. right clicking on the gray arrow next to an outline item of a report and select Edit > View Tree Structure. There will be an entry below the top outline box for the report called HelpKey=. Does anyone know how to use this in scripting, say to identify the type of report a script is trying to operate on?
Thanks!
M
Re: Can we use the "Helpkey" at the top of the tree structure for many reports?There is no direct way that I know of. You might could find it using XPath Query(). I don't use XPath Query much (or at all) myself.
Re: Can we use the "Helpkey" at the top of the tree structure for many reports?No, that won't work. The graphs (at this stage at least) are user generated and this annotation is happening after the fact. The result of doing a show is just a display box. It did give me the idea to test on the window title, since that is generated using a pattern and I can use a contains() argument to see what is there (see below). That said, I'd still like to know how to see what the help key value is from a script .
If( Contains( report, "Contour Plot" ) > 0,
Show(Contains( report, "Contour Plot" ));
Show( "found contour plot" ),
Show(Contains( report, "Contour Plot" ));
Show( "found something else" )
);
Re: Can we use the "Helpkey" at the top of the tree structure for many reports?If you're producing these graphs in JSL, they initially return the platform. You could get that, turn it into text and test for one platform or the other, Then use that information to go into the right piece of code. For example:
dt = Open("$sample_data/CrimeData.jmp");
cp = dt << Contour Plot(
X( :Violent Rate, :Property Rate ),
Y( :Population ),
By( :Region ),
Show Contours( 1 ),
Show Boundary( 1 ),
Fill Areas( 1 )
);
show(cp); // cp = {Contour Plot[], Contour Plot[], Contour Plot[], Contour Plot[], Contour Plot[], Contour Plot[], Contour Plot[], Contour Plot[]};
gb = dt << Graph Builder(
Variables( X( :Robbery Rate ), Y( :Larceny Rate ), Overlay( :Population ) ),
Elements( Points( X, Y, Legend( 22 ) ), Smoother( X, Y, Legend( 24 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
22,
Base( 0, 24, 0 ),
Base( 1, 24, 1 ),
Base( 2, 24, 2 ),
Base( 3, 24, 3 ),
Base( 4, 24, 4 )
)}
)
)
);
show(gb); // gb = Graph Builder[];
Re: Can we use the "Helpkey" at the top of the tree structure for many reports?Sure, the script I'm working on adds graphics via custom graphic scripts and adjusts axes settings. The target of these settings is dependent on the type of report due to the differences in the tree structure of the reports (i.e. between the contour platform and the graph builder platform). I'm trying to make the script robust to these differences.
One specific example is that contour plot has two frame boxes for each contour plot (one that contains the axis boxes and the graph box, and one that contains the legend). So the logic for applying the graphics script to each plot (in a situation where the use had used a "By" column requires that I step through frame boxes and axis boxes while skipping the frame boxes containing the legends. The situation with the Graph Builders tree structure 's entirely different and the logic that works for one won't work for the other. I thought that I might be able to test the helpkey to determine what type of graph the script was looking at and change the logic behind the scenes without additional user input.
M
Re: Can we use the "Helpkey" at the top of the tree structure for many reports?Do you have an example of what you're trying to do? I think there's probably an easier and more reliable way, but I don't know what you're working with. For example, do your reports have multiple platforms in them? Are they divided up in By Groups or Fit Groups? How are you producing the platform reports and getting references to them?
Re: Can we use the "Helpkey" at the top of the tree structure for many reports?Yes, I can see how that would be an issue, but I'm not planning on using it to find something but to determine what type of report the script is looking at (i.e. graph builder vs a contour plot.) So the question is how would I reference that in a script?
Re: Can we use the "Helpkey" at the top of the tree structure for many reports?Michael, we discourage the use of help keys in scripts. Help keys are subject to change during any release. It's safer to refer to a specific display box.