How to hide the whole table based on its row count

12 posts, 0 answers
  1. Edward
    Edward avatar
    54 posts
    Member since:
    Oct 2018

    Posted 17 Oct 2018 Link to this post

    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?

  2. Raul
    Raul avatar
    11 posts
    Member since:
    Aug 2017

    Posted 18 Oct 2018 in reply to Edward Link to this post

    You need to use an if() check this link: https://docs.telerik.com/reporting/expressions-evaluation-flow-functions
  3. Edward
    Edward avatar
    54 posts
    Member since:
    Oct 2018

    Posted 18 Oct 2018 in reply to Raul Link to this post

    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...

  4. Edward
    Edward avatar
    54 posts
    Member since:
    Oct 2018

    Posted 18 Oct 2018 in reply to Edward Link to this post

    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)?

  5. Raul
    Raul avatar
    11 posts
    Member since:
    Aug 2017

    Posted 18 Oct 2018 Link to this post

    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.
  6. Edward
    Edward avatar
    54 posts
    Member since:
    Oct 2018

    Posted 19 Oct 2018 in reply to Raul Link to this post

    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...
  7. Raul
    Raul avatar
    11 posts
    Member since:
    Aug 2017

    Posted 19 Oct 2018 Link to this post

    check, you have ( . ) after you  ( 0 ) is ( , ). check the image 
  8. Edward
    Edward avatar
    54 posts
    Member since:
    Oct 2018

    Posted 19 Oct 2018 in reply to Raul Link to this post

    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...)

  9. Edward
    Edward avatar
    54 posts
    Member since:
    Oct 2018

    Posted 19 Oct 2018 in reply to Edward Link to this post

    The mentioned PNG files... in support of previous post.
  10. Edward
    Edward avatar
    54 posts
    Member since:
    Oct 2018

    Posted 19 Oct 2018 in reply to Edward Link to this post

    Oops... this is correct one.  Without the A... Still doesn't work...
  11. Edward
    Edward avatar
    54 posts
    Member since:
    Oct 2018

    Posted 19 Oct 2018 Link to this post

    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. 
  12. Silviya
    Admin
    Silviya avatar
    335 posts

    Posted 22 Oct 2018 Link to this post

    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
Back to Top