Home
Intelligence (Analytics)
Outputting the query
fiber0pti
I'm trying to output the query that's being run to populate the report data. Is there a variable that I can use to actually display the exact query on the report itself?
Thanks!
Find more posts tagged with
Comments
mwilliams
Hi fiber0pti,
In the afterOpen method of the dataSet script, you can type the following to get the query text to a global variable.
reportContext.setPersistentGlobalVariable("quetext", this.queryText);
You can then place a data element into the report and as the expression put:
reportContext.getPersistentGlobalVariable("quetext");
This should give you what you're looking for.
fiber0pti
I'm not able to locate the afterOpen method. Where is this located?
mwilliams
fiber0pti,
In your designer, click on the dataSet in the Data Explorer. Then click on the Script tab underneath the report layout window. You should see a drop down then in the Script window that has the option of afterOpen.