Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
how do I toggle visibility of column in script?
gib65
<p>I'm trying to create a table that represents a person's tax slip. For example, a T4 slip. The database can return more than one tax slip for that person for that type (so one person may have multiple T4 slips). Our client wants the values for all the slips of a certain type (say T4) for a certain person to be put into additional columns.</p><p> </p><p>For example, one row for a person's T4 slip may look like:</p><p> </p><p>| Employee's EI Premiums | $100.00 | <-- one T4 returned</p><p> </p><p>or:</p><p> </p><p>| Employee's EI Premiums | $100.00 | $200.00 | <-- two T4s returned</p><p> </p><p>or:</p><p> </p><p>| Employee's EI Premiums | $100.00 | $200.00 | $300.00 <-- three T4s returned</p><p> </p><p>I haven't come across a way to add columns dynamically (having a fixed number of empty columns is not acceptable) so I'm thinking of creating something like 10 columns and making them all invisible at first. I would only make them visible if there is data added to them during the onFetch event.</p><p> </p><p>So my question is: how do I make the column visible during the onFetch event?</p>
Find more posts tagged with
Comments
mwilliams
<p>Well, depending on how your data is set up, this could just be a crosstab. What does the data look like in your dataset?</p>
gib65
<p style="margin-left:40px;">The dataset is a scripted dataset. Here's a screen capture of the output columns:</p><p style="margin-left:40px;"> </p><p>
gib65
<p>Is it possible to access a variable set in script from the expression builder.</p><p> </p><p>For example, suppose that on the beforeClose event for my scripted dataset, I counted the number of column the dataset has, and then set that in a variable called colCount. Then if I highlight my column, click on "Hide Element" in the visibility tab, and then for the expression, type something like:</p><p> </p><p>colCount < 3</p><p> </p><p>then would this work?</p>
gib65
<p>After a few attempts at this^^, I finally got it to work. I'm going to consider this problem solved.</p>
mwilliams
<p>Sorry for the delay. Glad you got a working solution!
</p>