Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Drop Element From a Report Design Based on Computed Column
Migrateduser
How can I drop a table or grid containing a table based on a computed column value from a data set? The computed column will contain "Yes" if the table should appear in the report or "No" if the table should not appear in the report. I am unable to use the visibility property of the table because I do not want the report item to still be processed.<br />
<br />
I have tried using a persistent global variable to store the value of the computed column in the onFetch event script of the data set:<br />
<br />
<em class='bbc'>reportContext.setPersistentGlobalVariable("DisplayMeValue", row["Display_Me"];</em><br />
<br />
<br />
Then I named the table "table1" that may or not be displayed depending on the computed column value and put in the beforeRender Report event script the following code:<br />
<br />
<em class='bbc'>var DisplayMeSetValue;<br />
<br />
DisplayMeSetValue = reportContext.getPersistentGlobalVariable("DisplayMeValue");<br />
<br />
if (DisplayMeSetValue == "No")<br />
{<br />
reportContext.getDesignHandle.findElement("table1").drop();<br />
}<br />
</em><br />
<br />
For some reason in the beforeRender Report event the code does not seem to recognize the value I set for the persistent global variable from the onFetch event of the data set. Even when the computed column value = "No", the table still appears in the report. The variable DisplayMeSetValue is null. I added a text box to the report to display the value of the persistent global variable using <em class='bbc'> <VALUE-OF>reportContext.getPersistentGlobalVariable("DisplayMeValue")</VALUE-OF></em> to make sure a value is actually being assigned and it looks like it is being set in the onFetch event to the computed column value. I do not understand why it is not recognized in the beforeRender event for the Report. What should I do differently? Is there a better way to accomplish the same task? Thank you!
Find more posts tagged with
Comments
There are no comments yet