How to extract a report name in a generic way using jslHi,
I would like to extract the report name using jsl. The script posted below is able to do so, but not for all types of reports. For example: I am able to extract the correct report name for a Graphbuilder report, but not for a Fit Manova report.
This results in an error: "Name Unresolved: rescript in access or evaluation of 'repscript', repscript/*###*/"
Is there a solution to make this script more generic/robust, so that it would work for all types of reports?
Names Default To Here(1);
dt=Current Data Table();
rep=Current Report();
//data table name
dtname=dt<<GET name=""></GET>
Thanks!
Automation and ScriptingBasic Data Analysis and ModelingData Exploration and VisualizationMass CustomizationSharing and Communicating ResultsRe: How to extract a report name in a generic way using jslThanks for the solution Jim and Hadley!
Much appreciated!
Re: How to extract a report name in a generic way using jslThe issue with the JSL you have been using, is that not all window titles provide the correct information to get the Scriptable Object that can retrieve the Script. I have found that using the initial Outline Box() from within the window is a more robust method. However, it still will not work in all cases. If a BY() group is specified, it will return the script for only the first BY() group. Here is my modification to the code
Names Default To Here(1);
dt=Current Data Table();
rep=Current Report();
//data table name
dtname=dt<<GET name=""></GET>
Re: How to extract a report name in a generic way using jslHi,
I modified your script a bit so that it now gets the scriptable object from OutlineBox(1) of the current report, rather than trying to use the report name (see below). Please try it out and let me know if it works for you.
Names Default To Here(1);
dt=Current Data Table();
rep=Current Report();
repSo=rep[OutlineBox(1)]<<GET scriptable="" object=""></GET>