This is a migrated thread and some comments may be shown as answers.

Making Table invisible when there is no data

2 Answers 989 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Srinath
Top achievements
Rank 1
Srinath asked on 24 Jul 2012, 12:11 AM
Hi,

I have a table in report header which displays summary data.
I want the table not to be disabled when there is no summary data.
I have created a binding on table with [Property path = Visible] and [Expression =IIF(Count(1)>0,True,False)].
 It gives me the below error when i run the report.
An error has occurred while processing Table 'table1': Aggregate node 'Count(Const(1))' not found. 

I think the expression value is incorrect. What expression will return me the rowcount. so that if the rowcount = 0 then i can make visible property = false.
Your help will be appreciated.

Thanks.
Srinath. 

2 Answers, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 24 Jul 2012, 05:03 PM
Hello Srinath,

You can easily do this with Report Parameters. Just create a new Report Parameter, give it:
DataSource =   // the same as the table you want to hide
Value =        = Count(Fields.ContactID) // it will be best to use an ID field as they always have value
ValueMember =         = Count(Fields.ContactID)
Visible =       False

Then in the conditional formatting of the table create new rule with this expression:
0  =       =Parameters.YourParameter.Value

Of course the parameter will not be visible for the users.

For more information please check our Report Parameters help article.

Greetings,
IvanY
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Richard
Top achievements
Rank 1
answered on 15 Sep 2020, 07:08 PM
This answer did not work for me to hide the table if it had no data.. What worked is to set NoDataStyle visible property to false and just put a space in NoDataMessage. Without the space in the NoDataMessage the empty table is displayed.  (reference:https://www.telerik.com/forums/set-a-table's-visibility-to-true-when-it-has-no-rows)
Tags
General Discussions
Asked by
Srinath
Top achievements
Rank 1
Answers by
IvanY
Telerik team
Richard
Top achievements
Rank 1
Share this question
or