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

How to hide the whole table based on its row count

11 Answers 982 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 17 Oct 2018, 06:37 PM

Am trying to set the conditional formatting of the table element based on the following Filter:

= Count(Fields.attributes.Discovery_Number) = 0

and if true, set the Style Visible to false.

But it's always returning true, so the table is always hidden even if it has rows.

What should be changed?

11 Answers, 1 is accepted

Sort by
0
Raul
Top achievements
Rank 1
answered on 18 Oct 2018, 02:03 PM
You need to use an if() check this link: https://docs.telerik.com/reporting/expressions-evaluation-flow-functions
0
Edward
Top achievements
Rank 1
answered on 18 Oct 2018, 04:54 PM

The conditional is built into the ConditionalFormatting field expression.  Please see attachment.

Is there something wrong with the expression below?

Count(Fields.attributes.Discovery_Number) , Fields.attributes.Discovery_Number is a field from the datasource the table is bound to...

0
Edward
Top achievements
Rank 1
answered on 18 Oct 2018, 05:02 PM

PS: there doesn't seem to be way to debug into code (using HTML5 report viewer- Telerik Reporting package, not the server).

Is there an option to debug into code to see what is happening with the conditional formatting filter?  Or to change its expression (for e.g. to use IIf instead of what's provided in the Properties window of the designer)?

0
Raul
Top achievements
Rank 1
answered on 18 Oct 2018, 09:15 PM
I just add a binding, just like see in the picture. that variable is a parameter from my proyect in c#, but you can set any value is the datasouce is from a procedure or wathever.
0
Edward
Top achievements
Rank 1
answered on 19 Oct 2018, 03:15 PM
Tried Binding like you suggested,  but doesn't work for me... It's always 0 (the count is), so it's always invisible even though I know table has rows...
0
Raul
Top achievements
Rank 1
answered on 19 Oct 2018, 05:14 PM
check, you have ( . ) after you  ( 0 ) is ( , ). check the image 
0
Edward
Top achievements
Rank 1
answered on 19 Oct 2018, 06:01 PM

Yup... it was just getting cut off in the properties window field.

Here is the full expression dialog screen capture- commas not periods...

I also found this property of the table- NoDataStyle and set the Visible field to false, while the main table's Style.Visible is true.

That doesn't work either.  In fact I find that many things of the table's Style properties don't work, like setting the BorderStyle and LineStyle and LineColor don't seem to have any effect.  (PS: the table's StyleName is set to Office.TableNormal.)  These... "appear" to be bugs... so makes me wonder if there isn't a bug with the expression values for the ConditionalFormatting or the Data.Binding fields...

Currently use the HTML5 report viewer option of the Telerik Report Service.  Are you using some other option where you have access to the source code...?  I have access to some customization API points, but don't have access into the source code to debug it.  Do you have source code access?  If so, I can at least debug and see if my syntax is wrong or if it's indeed a Telerik bug or something...

(PS: we are considering upgrading to the Report Server Devcraft Ultimate option...)

0
Edward
Top achievements
Rank 1
answered on 19 Oct 2018, 06:01 PM
The mentioned PNG files... in support of previous post.
0
Edward
Top achievements
Rank 1
answered on 19 Oct 2018, 06:33 PM
Oops... this is correct one.  Without the A... Still doesn't work...
0
Edward
Top achievements
Rank 1
answered on 19 Oct 2018, 08:48 PM
Was going about this the wrong way initially- using the Report Designer... instead of using the Report Library and defining my own reports with access to underlying C# classes and api's.  This would give me better controls and accessibility. 
0
Silviya
Telerik team
answered on 22 Oct 2018, 10:57 AM
Hi Edward,

The easiest way to achieve your requirement is to set a Binding rule on table's "header" textbox (https://www.screencast.com/t/fq6r9Qvr). For example:
Property Path    | Expression
Parent.Visible   | = IIf(Count(Fields.[attributes.Discovery_Number])=4, False, True)

Check the attached sample report that illustrates the suggested approach.

Regards,
Silviya
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Report Designer (standalone)
Asked by
Edward
Top achievements
Rank 1
Answers by
Raul
Top achievements
Rank 1
Edward
Top achievements
Rank 1
Silviya
Telerik team
Share this question
or