Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Hide crosstab with no values
fwhorton
Hello all,
I have a subreport (inside detail section of another report) crosstab with row / column area grand total and applying a filter. How do I hide / remove visibility if no data is displayed in the crosstab?
I tried using a global variable in the crosstab's onCreate and onPrepare script with no success since it appears they are called multiple times for some reason even when no data exists (guessing grand total).
Also, set global variable to zero i.e. reportContext.setGlobalVariable("count", 0) in detail section of main report then tried incrementing crosstab's onPrepareCell and it's incrementing to 1 when using reportContext.setGlobalVariable("count", reportContext.getGlobalVariable("count")++).
Thanks for you help.
Find more posts tagged with
Comments
mwilliams
Hi fwhorton,
Does the crosstab use a different dataSet? Or does it use the same dataSet that is used in the outer table? Can your reproduce your setup/issue with the sample database and attach the report? That might help me to see exactly what you're doing!
fwhorton
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="68320" data-time="1284065187" data-date="09 September 2010 - 01:46 PM"><p>
Hi fwhorton,<br />
<br />
Does the crosstab use a different dataSet? Or does it use the same dataSet that is used in the outer table? Can your reproduce your setup/issue with the sample database and attach the report? That might help me to see exactly what you're doing!
<br /></p></blockquote>
<br />
<br />
Thanks for looking into this mwilliams. Yes, the crosstab uses a different dataSet. How do I remove the crosstab for customerNumber 125 since no data exists? After that, I just need to default the crosstab blanks to $0.00.<br />
<br />
The upload says, "Error This upload failed" but I can upload other files but not the report. So I put the code below.
fwhorton
Removed posted report design.
mwilliams
fwhorton,
Can you attach your report in a zip file? Also, what is your BIRT version? The XML doesn't say the BIRT version and I'm not sure I have the correct one. I'll just open it in a newer version of BIRT if I can't find the correct version!
fwhorton
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="68415" data-time="1284493303" data-date="14 September 2010 - 12:41 PM"><p>
fwhorton,<br />
<br />
Can you attach your report in a zip file? Also, what is your BIRT version? The XML doesn't say the BIRT version and I'm not sure I have the correct one. I'll just open it in a newer version of BIRT if I can't find the correct version!
<br /></p></blockquote>
<br />
I zipped the report and attached it. I am working with myeclipse 8.6, which is eclipse 3.5.2, and uses BIRT 2.5.2.
mwilliams
fwhorton,
Unfortunately, you don't have access to the inner table values in the outer table to be able to hide the customer with no data. One thing you could do would be to place a text box that is attached to your details dataSet in front of your table, then in your details dataSet onFetch script, you could create a comma separated string list of the customers that appear in the dataSet. You can then use this comma separated list in visibility expressions of the detail rows of your table to hide the rows when the customernumber is not in your comma separated string variable. Or do you want the customer info to still be displayed? Let me know.
fwhorton
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="68458" data-time="1284582059" data-date="15 September 2010 - 01:20 PM"><p>
fwhorton,<br />
<br />
Unfortunately, you don't have access to the inner table values in the outer table to be able to hide the customer with no data. One thing you could do would be to place a text box that is attached to your details dataSet in front of your table, then in your details dataSet onFetch script, you could create a comma separated string list of the customers that appear in the dataSet. You can then use this comma separated list in visibility expressions of the detail rows of your table to hide the rows when the customernumber is not in your comma separated string variable. Or do you want the customer info to still be displayed? Let me know.<br /></p></blockquote>
<br />
Thanks for looking into this mwilliams. Yes, I still want the customer displayed. Your solution sounds good. I was hoping for an easier way. Another solution, create new dataset that takes a parameter and counts the customer's order details to use in visibility expression (global variable).
mwilliams
fwhorton,
If not trying to hide the customer info in the outer table too, you should be able to just use a visibility statement on the crosstab, checking if the outer row dimension is null. If it is, hide, if not, show. Hope this helps.