How to Hide Graph if No Data from Data Source?

5 posts, 0 answers
  1. Jonathan
    Jonathan avatar
    3 posts
    Member since:
    Apr 2015

    Posted 08 Apr 2015 Link to this post

    I have a graph that has a sql data source defined, but I want to be able to hide the graph if there is no data being returned from the data source.  I tried to bind the Visible property, but the Fields list is empty even though I have the data source defined and it is working fine when there is data.  I thought I would be able to do Visible = Count(Fields.PatName) > 0 since PatName is a field being returned by the SQL data source.
  2. Nasko
    Admin
    Nasko avatar
    1067 posts

    Posted 09 Apr 2015 Link to this post

    Hello Jonathan,

    You will need to set the ​NoDataMessage Property first and then set NoDataStyle.VisibleFalse to hide the message and effectively hide the whole graph.

    More information on the topic is available in the How to: Set a No Data Message help article.

    Regards,
    Nasko
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. Jonathan
    Jonathan avatar
    3 posts
    Member since:
    Apr 2015

    Posted 09 Apr 2015 Link to this post

    Thanks, that was exactly what I was looking for.
  4. Jonathan
    Jonathan avatar
    3 posts
    Member since:
    Apr 2015

    Posted 09 Apr 2015 Link to this post

    Another question: I still get a bunch of blank pages even though the elements are hidden.  Is there a way that I can set the detail section height to 0 if the table within it has no data and is hidden?
  5. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 10 Apr 2015 Link to this post

    Hello Jonathan,

    Please test shrinking the container item or section with the settings from the Collapse the container when hiding child report items KB article. Does not set the any dimension to 0 unit, it is better to use a conditional formatting rule or binding to hide the item/section.

    Once hidden, the rest items.sections will be positioned based on the Design Considerations for Report Item Layout.


    I hope this helps you.

    Regards,
    Stef
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top