Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Empty Group Tree - how do I hide if there are no groups?

Status
Not open for further replies.

ElaineRC

Programmer
Jan 20, 2005
7
GB
I want to hide the Group Tree (in the viewer control) at run time if there are no groups. Does anyone know how I can do this?

I know I need to say DisplayGroupTree = false but i dont know how to do the 'if no groups' bit.

I'm using VB.Net and CR10.

Thanks
 
I do it in my VB 6 Viewer application by looping through the report's Areas collection for any Group Footers, then enable/disable the Group Tree based on the result:
Code:
Dim blnGroups As Boolean
Dim crxArea As CRAXDRT.Area

'Look for any Groups to determine whether or not to show the Group Tree
For Each crxArea In crxRpt.Areas
    If crxArea.Kind = crGroupFooter Then
        blnGroups = True
    End If
Next crxArea 

Viewer.EnableGroupTree = blnGroups
Hope that points you in the right direction.

-dave
 
Thanks for your help. I can see it would work fine by I have an added complexity - my report does have a group area in it, which can be suppressed (controlled by a user parameter). So i need to say:

For Each crxArea In crxRpt.Areas
If crxArea.Kind = crGroupFooter Then
IF NOT crxArea.SUPPRESSED THEN blnGroups = True
End If
Next crxArea

I can't find a property to do this... any ideas?
Hope this makes sense
Elaine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top