Print Page | Close Window

Report Control - Group Rows

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=9773
Printed Date: 08 September 2024 at 1:02pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Report Control - Group Rows
Posted By: Roken
Subject: Report Control - Group Rows
Date Posted: 03 March 2008 at 6:53am

Hi there, can someone give me the syntax to return the data on a 'Group' row?

I have a grid grouped by "Customer Name" - so my first 'Group' row in the grid reads;
 
"Customer Name:ABC"
 
ABC being the first customer in the list.
 
Thanks in advance
 
 



Replies:
Posted By: wlcabral
Date Posted: 03 March 2008 at 9:11pm

*  example for MS FOXPRO :

oSelectd = reportControl.SelectedRows

if oSelectd.Count > 0

 oParent = oSelectd.Row(0).ParentRow
 if !isNull(oParent)
  if oParent.GroupCaption =true
   ? oParent.GroupCaption 
  endif

 endif
endif



-------------
wlcabral


Posted By: Roken
Date Posted: 04 March 2008 at 4:39am
Thanks for your reply, unfortunately I need a visual basic 6 example.
 
 
In order to populate a report in excel I need the contents of the highlighted rows.


Posted By: nighthawk
Date Posted: 07 March 2008 at 10:40am
You might try something like this:

    Dim i As Long
    Dim GroupRow As XtremeReportControl.ReportGroupRow
    Dim ReportRow As XtremeReportControl.ReportRow
   

    'loop through report control records
    i = 0
    Do While (i < objReportControl.Rows.Count)
       
        If (objReportControl.Rows(i).GroupRow = True) Then
            'this is a group row so convert it to ReportGroupRow type
           
            Set GroupRow = objReportControl.Rows(i)
            MsgBox GroupRow.GroupCaption
       
        Else
            'this is not a group row so treat it as normal ReportRow type
           
            Set ReportRow = objReportControl.Rows(i)
            MsgBox ReportRow.Record.Item(1).Caption
           
        End If
           
        i = i + 1
    Loop


I haven't actually tested the above code but it is a simplified version of what I use so it should work.



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