Print Page | Close Window

Setting GroupCaption

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=6736
Printed Date: 10 July 2024 at 5:32pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Setting GroupCaption
Posted By: jcollier
Subject: Setting GroupCaption
Date Posted: 26 March 2007 at 12:55pm
I need to traverse the report control bottom to top, making calculations along the way and updating GroupCaption with those Calculations.  Any idea how to accomplish this?



Replies:
Posted By: jcollier
Date Posted: 26 March 2007 at 1:40pm
Got it.  Pieced together a few different posts.

Private Sub rpt_ColumnOrderChanged()

    Dim i As Long
    Dim lngCount As Long
    Dim lngTotalTime As Long
    Dim Row As ReportRow
   
    For i = rpt.Rows.count - 1 To 0 Step -1
        Set Row = rpt.Rows(i)
        If Row.GroupRow Then
            Row.GroupCaption = Row.GroupCaption + " -- Total Time: " + Format(lngTotalTime / 60, "0.00") + " -- Quantity: " + CStr(lngCount)
            lngTotalTime = 0
            lngCount = 0
        Else
            lngTotalTime = lngTotalTime + CLng(Row.Record.Item(COL_TOTALTIME).Tag)
           
            If Row.Record.Item(COL_QUANTITY).Value <> vbNullString Then
                lngCount = lngCount + CLng(Row.Record.Item(COL_QUANTITY).Value) + 0
            End If
        End If
    Next i
End Sub



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