Dynamic Formula in Group Rows |
Post Reply |
Author | |
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
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
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) -
|
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Added Cascade Group Box Formula support - http://forum.codejock.com/forum_posts.asp?TID=14837&PN=1
e.g. SubTotal by internal SubTotals
|
|
joeliner
Senior Member Joined: 09 June 2006 Status: Offline Points: 273 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
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).
Please try to make sample based on https://forum.codejock.com/uploads/20090813_220005_GroupFormula.rar
but wil more columns and data and try new ocx
|
|
joeliner
Senior Member Joined: 09 June 2006 Status: Offline Points: 273 |
Post Options
Thanks(0)
|
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 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Coming version will support multiple subtotal in group rows (dynamic formula) -
archive with beta has VB6 samples with this new feature:
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Hope you understand mixed url - should be https://forum.codejock.com/uploads/BetaOCX/ReportControlBeta13-2-2.rar
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
This the picture of new feature - https://support.codejock.com/Attachments/20091228-140707_GroupRowsWithMultipleSubtotals.jpg
|
|
Genius
Newbie Joined: 03 September 2010 Location: India Status: Offline Points: 1 |
Post Options
Thanks(0)
|
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. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |