Expand/Collapse show Group & Sub Group Headings |
Post Reply |
Author | |
SHAN
Groupie Joined: 17 July 2010 Location: Dubai Status: Offline Points: 73 |
Post Options
Thanks(0)
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 |
|
Hemesh
Senior Member Joined: 10 August 2010 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
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 |
|
SHAN
Groupie Joined: 17 July 2010 Location: Dubai Status: Offline Points: 73 |
Post Options
Thanks(0)
|
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 |
|
Hemesh
Senior Member Joined: 10 August 2010 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
Hemesh
Senior Member Joined: 10 August 2010 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
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 |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
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.... |
|
Hemesh
Senior Member Joined: 10 August 2010 Status: Offline Points: 135 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |