Print Page | Close Window

Grouped Row Caption

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=7535
Printed Date: 20 September 2024 at 12:11am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Grouped Row Caption
Posted By: shagge22
Subject: Grouped Row Caption
Date Posted: 05 July 2007 at 2:33pm
I am using report control v. 10.3. I have noticed that when I update the group caption, the updated text disappears when the populate event is called, why? I have been able to get around the issue, but is there an easy way to keep this from occurring? Here is the code that I am using to perform the group caption update...

Dim sDoc As String
Dim rRow As ReportRow
Dim rGrp As ReportGroupRow

For Each rRow In Rpt_List.Rows
    If rRow.GroupRow Then
        Set rGrp = rRow
        If rGrp.Childs.count = 1 Then
            sDoc = " Document"
        Else
            sDoc = " Documents"
        End If
        rGrp.GroupCaption = rGrp.GroupCaption + " (" +   
        CStr(rGrp.Childs.count) + sDoc + ")"
    End If
Next
Rpt_List.Redraw



Replies:
Posted By: sserge
Date Posted: 05 July 2007 at 4:57pm
Hi,

Take a look at http://forum.codejock.com/forum_posts.asp?TID=4246 - http://forum.codejock.com/forum_posts.asp?TID=4246

As you can see there, the main suggestion is to handle _BeforeDrawRow event and add there a code like:

If Row.GroupRow Then
    If Row.Childs.Count > 1 Then
    Metrics.Text = Row.GroupCaption + " (" + CStr(Row.Childs.Count) + ") documents"
  Else
      Metrics.Text = Row.GroupCaption + " Document"
  End If
End If


--
WBR,
Serge


Posted By: shagge22
Date Posted: 10 July 2007 at 11:54am
Thanks for the code. That works great.



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