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

Table Conditional Visibility

5 Answers 2583 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 20 Jul 2011, 08:29 PM
I am trying to display a table only if it contains rows in a Telerik Report.  I have tried various ways of setting the conditional formatting, but to no avail.

Any ideas?

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 21 Jul 2011, 09:18 AM
Hi Justin,

The easiest way to achieve your requirement is to set a Binding for a table "header" Textbox.

 Property Path Expression 
 Parent.Visible  =IIF(Count(1)>0, True, False)

Check out the attached sample report that illustrates the suggested approach.

Regards,
Steve
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Srinath
Top achievements
Rank 1
answered on 24 Jul 2012, 12:10 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.
0
Steve
Telerik team
answered on 24 Jul 2012, 06:38 AM
Hi Srinath,

Check out the attached project from our previous reply which works as expected.

Regards,
Steve
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
Srinath
Top achievements
Rank 1
answered on 24 Jul 2012, 03:28 PM
Hi Justin,

Thanks for the reply.
I have already gone through the project files you have attached before posting.

How do i set Parent.Visible property? I can't see Parent.visible in property path, i just see visible in property path.
If i set Visible to IIF(Count(1)>0,True,False), the header is not displayed when there is no data.

If i add the below code after InitializeComponent() method in Constructor it works,
this.textBox1.Bindings.Add(new Telerik.Reporting.Binding("Parent.Visible", "=IIF(Count(1)>0,True,False)"));

I don't understand why i can't see Parent.Visible property?

Thanks.
Srinath
0
Steve
Telerik team
answered on 27 Jul 2012, 11:07 AM
Hello Srinath,

Thanks for the clarification. As Parent is a reference to the parent object, it is not immediately available in the expression, but you can type it in manually like we have done in the sample report from the original post.

All the best,
Steve
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 >

Tags
General Discussions
Asked by
Justin
Top achievements
Rank 1
Answers by
Steve
Telerik team
Srinath
Top achievements
Rank 1
Share this question
or