How to hide subreports if they do not have the data needed to be display

2 posts, 0 answers
  1. Kelly
    Kelly avatar
    4 posts
    Member since:
    Mar 2013

    Posted 30 Jan 2018 Link to this post

    I found the following answer in Reporting Forum:

    But I don't know how to check the data count within SubReport1_NeedDataSource

    We are using a SQLdatasource.

    Thanks...

    Kelly

     

    https://www.telerik.com/forums/how-to-hide-subreports-if-they-do-not-have-the-data-needed-to-be-display#s7pqNThtmkS75q1uwVoqrg

       Private Sub SubReport1_NeedDataSource(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SubReport1.NeedDataSource  
            Dim subReport As Telerik.Reporting.Processing.SubReport  
            subReport = CType(sender, Telerik.Reporting.Processing.SubReport)  
     
            If (...no data expression...) Then 
                subReport.Visible = False 
            End If 
        End Sub 

     

  2. Katia
    Admin
    Katia avatar
    693 posts

    Posted 02 Feb 2018 Link to this post

    Hello Kelly,

    Test using a built-in function that gets the count of sub report's records. Based on the result of the expression you can toggle the visibility of the parent section. For more details, check this forum post.


    Regards,
    Katia
    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