Friday, June 11, 2010 7:51 PM
I have two charts which are based on their own separate datasets. One chart shows data aggregated by MONTH, the other chart shows data aggregated by WEEK. I have put both of these charts inside a rectangle and set their visibility based on whether or not there is data returned by their respective datasets. This part is working just fine.
However, I have added a tablix to the report, deleted all columns and rows leaving only one remaining row/column so it looks like a textbox. This tablix is sitting on top of the two charts. The problem i'm having is that when both charts return no data and they do not show up in the report, the tablix still remains visible. I need to set the visibility but based on a condition between the two different datasets behind each chart.
Here's what I need: If ONE of the charts returns data, then I need the tablix to be visible. If neither chart returns data, then I need the tablix to be invisible. I'm trying to write an IIF statement comparing the two datasets but I get inscope errors. Isn't it possible to compare values which are contained in two separate datasets in SSRS?
Seems like something like the following logic should work:
IIF(CountRows("Monthly_DataSet") > 0 OR CountRows("Weekly_DataSet") > 0 , FALSE, TRUE)
Obviously the above expression will return syntax errors, but you'll get the point as to how i'm thinking.
How can I set the visibility of the tablix based on these two charts?
Friday, June 11, 2010 10:42 PM
actually I dont see why that expression wouldnt work
did you make sure those dataset string names match? (including the case)
Monday, June 14, 2010 6:42 AM
Nehemiah is right. It should work that way itself. I tried it myself after reading your post.
One can compare the row count values of two datasets.
Wednesday, June 16, 2010 5:18 AMModerator
Generally,it shouldn't conclude some syntax just like other memebers mentioned. Try this expression =IIF((CountRows("Monthly_DataSet")=0 and CountRows("Weekly_DataSet")=0) ,true,false) to see whether it works. Make sure you get the right dataset's name. Thanks.
- Marked As Answer by Challen FuModerator Friday, June 18, 2010 9:32 AM