Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - How to recalculate row formula on sort change
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to recalculate row formula on sort change

 Post Reply Post Reply
Author
Message
Carrolo View Drop Down
Newbie
Newbie


Joined: 25 November 2014
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Carrolo Quote  Post ReplyReply Direct Link To This Post Topic: How to recalculate row formula on sort change
    Posted: 25 November 2014 at 12:09pm
I have a grid where the last column is SUM(R0*C8:R" & Me.ReportControl1.Records.Count & "*C9)
But, when re-sort, even changing the formula, it doesn't work.
 
This is the code that i use to change the formula:
 
Private Sub ReportControl1_SortOrderChanged()
    Dim i As Integer
    Dim Row As ReportRow
    Dim ReportRow   As ReportRow
    For i = 0 To ReportControl1.Rows.Count - 1
        Set Row = ReportControl1.Rows(i)
        If Not Row.GroupRow Then
            Set ReportRow = Row
            ReportRow.Record.Item(9).Formula = "SUM(R0*C8:R" & i & "*C9)"
        End If
    Next
    ReportControl1.ReCalc True
    ReportControl1.Redraw
End Sub
 
Hope you can help me
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.125 seconds.