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

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

1 Answer 50 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kelly
Top achievements
Rank 1
Kelly asked on 30 Jan 2018, 06:11 PM

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 

 

1 Answer, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 02 Feb 2018, 01:57 PM
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
Tags
General Discussions
Asked by
Kelly
Top achievements
Rank 1
Answers by
Katia
Telerik team
Share this question
or