Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Cant Sum Up!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Cant Sum Up!

 Post Reply Post Reply
Author
Message
JamGodz View Drop Down
Groupie
Groupie
Avatar

Joined: 25 February 2010
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamGodz Quote  Post ReplyReply Direct Link To This Post Topic: Cant Sum Up!
    Posted: 22 September 2010 at 7:34am
Hi Everyone!

If item had a comma it wont sum up... is this a limitation?Cry



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

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 22 September 2010 at 8:05am
Hi,
 
Yes, it is but already added this to my list.
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
JamGodz View Drop Down
Groupie
Groupie
Avatar

Joined: 25 February 2010
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamGodz Quote  Post ReplyReply Direct Link To This Post Posted: 22 September 2010 at 9:28am
Thanks Aaron!
Back to Top
JamGodz View Drop Down
Groupie
Groupie
Avatar

Joined: 25 February 2010
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamGodz Quote  Post ReplyReply Direct Link To This Post Posted: 10 January 2011 at 8:12pm
Hi Aaron! Good Day! and Happy New Year!

How's the comma in Sum? is it implemented in new release? tnx
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: 10 January 2011 at 10:09pm
Strangely, it appears that the GroupFormula uses the Item.Caption property instead of the Item.Value property, which makes no sense to me, since I thought you would use Item.Value to store the "real" value of an Item, and the Caption property to store the value formatted for display purposes.

For example, I would have hoped that this would work:


Set xRecord = wndReport.Records.Add
With xRecord.AddItem(CCur("10,000"))
   .Caption = Format$(.Value, "#,##0.00")
End With


But because the SUMSUB formula uses the Caption property for its calculations, it fails.

Instead you have to jump through hoops with BeforeDrawRow and Metrics.Text (but it then does work as expected):


Option Explicit

Private Sub Form_Load()
   With Me.ReportControl1
      With .Columns.Add(.Columns.Count, "Test", 100, True)
         .Groupable = True
      End With
      With .Columns.Add(.Columns.Count, "Test", 100, True)
         .Alignment = xtpAlignmentRight
      End With
     
      .ShowGroupBox = True
      .HideColumnAfterGroupBoxDrop = False
     
      .SetCustomDraw xtpCustomBeforeDrawRow
     
      With .Records.Add
         .AddItem "G1"
         .AddItem CCur("10000")
      End With
      With .Records.Add
         .AddItem "G1"
         .AddItem CCur("10,020.22")
      End With
      With .Records.Add
         .AddItem "G2"
         .AddItem CCur("1000")
      End With
     
      .GroupsOrder.Add .Columns(0)
      .Populate
     
      ReportControl1_GroupOrderChangedEx .Columns(0), xtpReportColumnGroupOrderChanged
   End With
End Sub

Private Sub ReportControl1_BeforeDrawRow(ByVal Row As XtremeReportControl.IReportRow, ByVal Item As XtremeReportControl.IReportRecordItem, ByVal Metrics As XtremeReportControl.IReportRecordItemMetrics)
   If Not Row.GroupRow Then
      If Item.Index = 1 Then
         Metrics.Text = Format$(Item.Value, "#,##0.00")
      End If
   End If
End Sub

Private Sub ReportControl1_GroupOrderChangedEx(ByVal Column As XtremeReportControl.IReportColumn, ByVal Reason As XtremeReportControl.XTPReportColumnOrderChangedReason)
   Dim lo_Row As ReportRow
   Dim lo_GroupRow As ReportGroupRow
  
   For Each lo_Row In Me.ReportControl1.Rows
      If lo_Row.GroupRow Then
         Set lo_GroupRow = lo_Row
        
         lo_GroupRow.GroupFormula = "SUMSUB(R*C1:R*C2)"
         lo_GroupRow.GroupFormat = "Total: %.02f"
         lo_GroupRow.GroupCaption = "x"
      End If
   Next lo_Row
  
End Sub


Is there a good reason why the formulas should use the Caption property instead of the Value property? Or am I doing something wrong?
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6

Back to Top
JamGodz View Drop Down
Groupie
Groupie
Avatar

Joined: 25 February 2010
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamGodz Quote  Post ReplyReply Direct Link To This Post Posted: 01 March 2011 at 8:20pm
is this available in version 15?
Back to Top
JamGodz View Drop Down
Groupie
Groupie
Avatar

Joined: 25 February 2010
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamGodz Quote  Post ReplyReply Direct Link To This Post Posted: 07 March 2011 at 7:29pm
Hi Aaron... just would like to know the update of this... is this incorporate to the new release(v15)?
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 09 March 2011 at 4:22pm

Hi,

I tried with some sample and I'm able to assign values like 13,6 or 13.6 and both values are calculated in GroupFormula the right way.

btw I tried with V15.0.2
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
JamGodz View Drop Down
Groupie
Groupie
Avatar

Joined: 25 February 2010
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote JamGodz Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2011 at 9:06pm
Hi Aaron,

Thank you for your reply... how about the "Total in Footer"?

thanks.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2011 at 1:26am
Originally posted by Aaron Aaron wrote:

Hi,

I tried with some sample and I'm able to assign values like 13,6 or 13.6 and both values are calculated in GroupFormula the right way.

btw I tried with V15.0.2
 
 
 
Hi,
 
I looked at topmost post and saw that you use a comma for thousand separator and you expect the formula would calculate it as "ten thousand" ???  
 
I said it is working but I didn't know what you ment, sorry. 
 
About footer, I didn't test it but I don't think it's implemeted yet. Surely CJ would add something to release notes if they had...
 
Good luck Wink
 
 
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
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.141 seconds.