Print Page | Close Window

How to recalculate row formula on sort change

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=22473
Printed Date: 27 April 2024 at 10:12am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to recalculate row formula on sort change
Posted By: Carrolo
Subject: How to recalculate row formula on sort change
Date 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



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