Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Dynamic Formula in Group Rows
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Dynamic Formula in Group Rows

 Post Reply Post Reply
Author
Message
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Topic: Dynamic Formula in Group Rows
    Posted: 13 August 2009 at 9:38pm
I add Formula support to Group Rows -
 
 
and you can play with small VB model - 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)   -
 
 
Back to Top
jpbro View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 January 2007
Status: Offline
Points: 1355
Post Options Post Options   Thanks (0) Thanks(0)   Quote jpbro Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 14 August 2009 at 8:43pm
Added Cascade Group Box Formula support - http://forum.codejock.com/forum_posts.asp?TID=14837&PN=1
e.g. SubTotal by internal SubTotals
Back to Top
joeliner View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 June 2006
Status: Offline
Points: 273
Post Options Post Options   Thanks (0) Thanks(0)   Quote joeliner Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2009 at 1:01pm
Fresh (Aug 20) ocx version - 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).
 
but wil more columns and data and try new ocx
Back to Top
joeliner View Drop Down
Senior Member
Senior Member
Avatar

Joined: 09 June 2006
Status: Offline
Points: 273
Post Options Post Options   Thanks (0) Thanks(0)   Quote joeliner Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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:

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 03 January 2010 at 12:22am
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 04 January 2010 at 3:57pm
Back to Top
Genius View Drop Down
Newbie
Newbie
Avatar

Joined: 03 September 2010
Location: India
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Genius Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.234 seconds.