Print Page | Close Window

Expand/Collapse show Group & Sub Group Headings

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=17213
Printed Date: 15 November 2024 at 1:17pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Expand/Collapse show Group & Sub Group Headings
Posted By: SHAN
Subject: Expand/Collapse show Group & Sub Group Headings
Date Posted: 07 September 2010 at 4:42am
Hi,
 
In Report control I have  Main Group and sub Groups.
 
Normally if you Expand All it shows All Records Including Sub Group Records.
 
What I want is Expand only group Headings only (Summary only,No Need to Show Records).
 
It's a waste of time if you have 100's of group and sub group inside,Clicking manually one by one group to see sub group Headings summary
 
Is that Possible? If so How? Please help
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows 7 Professional
Language: Visual Basic 6.0



Replies:
Posted By: Hemesh
Date Posted: 10 September 2010 at 4:33am
Do you mean by just iterating the records through the report control?

For each recTemp in ReportControl1.Records
   recTemp.Expanded = True
Next recTemp


-------------
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0


Posted By: SHAN
Date Posted: 12 September 2010 at 5:26am
Hi Hemesh ,
 
If you use CollapseAll it will Collapse All rows and will show only Group Summary(Subgroups Hidden, you have to Expand group summary byclick
so that you can view Sub group summary)
 
But what I want is I want to view Group Summay + Subgroups Summary+ Subgroups Summary+...etc visible when I call Collapse All method
 
Instead of CollapseAll, I want CollapseGroups...!
 
How to do this? Any Idea?
 
 
  


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows 7 Professional
Language: Visual Basic 6.0


Posted By: Hemesh
Date Posted: 13 September 2010 at 3:21am
Sorry, mis-understood from first question... what you need is a function like so (but with your own error handling): -

Private Sub ExpandShowingSummary(ByRef rwsTemp As ReportRows, ByVal blnExpanded As Boolean)
    Dim rowTemp As ReportRow
   
    For Each rowTemp In rwsTemp
        If rowTemp.GroupRow Then
            ExpandShowingSummary rwsTemp:=rowTemp.Childs, blnExpanded:=blnExpanded
            rowTemp.Expanded = blnExpanded
        End If
    Next rowTemp

    Set rowTemp = Nothing
End Sub


and then you can call this function in you expand all and collapse all buttons like this: -

Private Sub mnuExpandCollapse_Click()
    m_blnExpanded = Not m_blnExpanded
    ExpandShowingSummary rwsTemp:=wndReportControl.Rows, blnExpanded:=m_blnExpanded
End Sub


In my case example, I have a menu item that toggles the expand/collapse with a modular variable m_blnExpanded that holds what states it in. But if you have two buttons/menus then you don't need the variable.

:)


-------------
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0


Posted By: Aaron
Date Posted: 13 September 2010 at 8:46am
Hi guys,
 
Of course built in functions are easier to use in your own code  But what about next level (or next and next and next...) 
 
But there's more to it than above code to work. What about if .Populate is called? All rows will be expanded !!! So you need to call your function when the Report needs to be redrawn (adding record, sorting etc etc) The thing that we really need is an option to prevent the rows from expanding when .Populate is called. When adding records it easy to set Expanded to false within same function...
 
I also have a report with events (thousands and thousands) and when grouping is applied I don't want the main group to be expanded whenever an event is added (I have to call .Populate otherwise the record doesn't show) so I created an array which holds the value of expanded grouprow (true or false) maybe because user expanded row in meantime to have a look at the childs of the main group. So I have to store expanded value somewhere.
 
Well, glad there are some members willing to discuss this a little further
  


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Hemesh
Date Posted: 13 September 2010 at 9:15am
I didn't realise the .populate expands everything... is this only when things are grouped? I don't use grouping and use ReportRecords and child Records. Of course that means the user can't easily drag headings to customise their groupings... so makes my job easier :)

-------------
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0


Posted By: Aaron
Date Posted: 13 September 2010 at 9:41am
Originally posted by Hemesh Hemesh wrote:

I didn't realise the .populate expands everything... is this only when things are grouped? I don't use grouping and use ReportRecords and child Records. Of course that means the user can't easily drag headings to customise their groupings... so makes my job easier :)
 
I'm not 100% sure for Parent/child records (because I don't use them) but for grouped records it expands them everytime. I expect it does the same in your case. Well try it yourself, just call populate after you collapsed some parents. As you replied in one post... the developer is lazy... Well in this case I recommend you use grouping and don't have to add code (maybe a few lines to set .Caption for grouprow, GroupPriority and SortPriority for sorting) to organize parent/child grouping.
 
     


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: Hemesh
Date Posted: 14 September 2010 at 7:16am
I'm not lazy in my case as the big guy above preffered the look without the user grouping for some reason and wanted that. Wasn't much code to group and whatnot, and glad it doesn't expand/collapse the rows everytime it populates 

-------------
Product: Xtreme SuitePro (ActiveX) version 18.5.0

Platform: Windows 7 Enterprise (64-bit)

Language: Visual Basic 6.0



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net