Print Page | Close Window

Dynamic Formula in 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=14968
Printed Date: 25 November 2024 at 1:04am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Dynamic Formula in Group Rows
Posted By: mdoubson
Subject: Dynamic Formula in Group Rows
Date Posted: 13 August 2009 at 9:38pm
I add Formula support to Group Rows -
 
you need to get fresh ocx version - https://forum.codejock.com/uploads/DemoVersion/ReportControlUpdated.rar - https://forum.codejock.com/uploads/DemoVersion/ReportControlUpdated.rar
 
and you can play with small VB model - https://forum.codejock.com/uploads/20090813_220005_GroupFormula.rar - uploads/20090813_220005_GroupFormula.rar
 
to see how it set and work - (e.g. it is good to see dynamic subtotal for group rows childs as you can see on snapshot)
 
If you change your group (drop Product back to report header and drop Sales to GroupBox - you will see another result - subtotal by another criteria)   -
 
 


-------------
Mark Doubson, Ph.D.



Replies:
Posted By: jpbro
Date Posted: 14 August 2009 at 12:05am
Nice! Funny thing - I was just wondering today if built-in group subtotals were possible!

-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: mdoubson
Date Posted: 14 August 2009 at 12:35am

Build-In code you can see in VB source - only for inital GroupOrder. If you drop Product column back to header - group row (and same time code) will destroyed.

But we can assign it on-fly - as our respond on GroupOrderChanged notification (for xtpReportColumnAddedToGroupby case)

Private Sub wndReport_GroupOrderChangedEx(ByVal Column As XtremeReportControl.IReportColumn, ByVal Reason As XtremeReportControl.XTPReportColumnOrderChangedReason)
    Dim i As Integer
    Dim row As ReportRow
    Dim groupRow As ReportGroupRow
    Dim xRecord As XtremeReportControl.ReportRecord
    Dim xRecordItem As XtremeReportControl.ReportRecordItem
    If Reason & xtpReportColumnAddedToGroupby Then
        For i = 0 To wndReport.Rows.Count - 1
            Set row = wndReport.Rows(i)
            If row.groupRow Then
                Set groupRow = row
                    groupRow.GroupFormat = " Subtotal $=%.02f"
                    groupRow.GroupFormula = "SUMSUB(R*C1:R*C8)"
                    groupRow.GroupCaption = "x"
            End If
        Next
    End If
End Sub


-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 14 August 2009 at 8:43pm
Added Cascade Group Box Formula support - http://forum.codejock.com/forum_posts.asp?TID=14837&PN=1 - http://forum.codejock.com/forum_posts.asp?TID=14837&PN=1
e.g. SubTotal by internal SubTotals

-------------
Mark Doubson, Ph.D.


Posted By: joeliner
Date Posted: 17 August 2009 at 12:51am
Great Minds...

I had implemented a function that makes use of wndReportControl_GroupOrderChangedEx and based on the grouped columns the user can add or remove groups and auto-calculate the totals on the sub totals.

Am currently calculating the totals manually using GroupRow.Childs.Row(i).Record(r)Value and hoping to switch to the formula property.


-------------
Product: Xtreme SuitePro (ActiveX) version 13.1
Platform: Windows XP SP 3
Language: Visual Basic 6 SP6


Posted By: mdoubson
Date Posted: 20 August 2009 at 1:01pm
Fresh (Aug 20) ocx version - https://forum.codejock.com/uploads/DemoVersion/ReportControlUpdated.rar - https://forum.codejock.com/uploads/DemoVersion/ReportControlUpdated.rar
used resursive function for group row formula (means that your groups can be any level of deep).
 
Please try to make sample based on https://forum.codejock.com/uploads/20090813_220005_GroupFormula.rar - https://forum.codejock.com/uploads/20090813_220005_GroupFormula.rar  
but wil more columns and data and try new ocx


-------------
Mark Doubson, Ph.D.


Posted By: joeliner
Date Posted: 21 August 2009 at 9:00am
Hi Mark,
 
Thanks for the updates.
 
Going live on a project so may not be able to fully play-around with all the new features till early september. But for the few av been able to test I must say 'CJ, you are on the right track.'
 
Kudos.
 
regards,


-------------
Product: Xtreme SuitePro (ActiveX) version 13.1
Platform: Windows XP SP 3
Language: Visual Basic 6 SP6


Posted By: mdoubson
Date Posted: 02 January 2010 at 2:50am
Coming version will support multiple subtotal in group rows (dynamic formula) -
archive with beta has VB6 samples with this new feature:

https://forum.codejock.com/uploads/BetaOCX/CalendarBeta13-2-2.rar - https://forum.codejock.com/uploads/BetaOCX/CalendarBeta13-2-2.rar


Posted By: mdoubson
Date Posted: 03 January 2010 at 12:22am
Hope you understand mixed url - should be https://forum.codejock.com/uploads/BetaOCX/ReportControlBeta13-2-2.rar - https://forum.codejock.com/uploads/BetaOCX/ReportControlBeta13-2-2.rar

-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date Posted: 04 January 2010 at 3:57pm
This the picture of new feature - https://support.codejock.com/Attachments/20091228-140707_GroupRowsWithMultipleSubtotals.jpg - https://support.codejock.com/Attachments/20091228-140707_GroupRowsWithMultipleSubtotals.jpg

-------------
Mark Doubson, Ph.D.


Posted By: Genius
Date Posted: 05 September 2010 at 2:17am
Hi

      Can somebody help me to display total in group rows. as shown in following screenshot.



available example in this forum is in VB. what will be the equivalent code in VC++.

Thanx in advance.



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