I'm trying to make a textbox in the footer the difference of two textbox value.
One is a sum value of a data item, the other is a value generated via codebehind.
I've tried this:
Private Sub ReportFooterSection1_ItemDataBound(sender As Object, e As EventArgs) Handles ReportFooterSection1.ItemDataBound oConn.Open() Dim ocmd As New SqlCommand("SELECT * FROM tblDynamic", oConn) ocmd.CommandType = SqlDataSourceCommandType.Text Dim reader As SqlDataReader reader = ocmd.ExecuteReader If reader.HasRows Then reader.Read() _txtLoansPerFinancial.Value = reader("TotalLoansPerFinancials").ToString() _txtLoanDifference.Value = _txtLoansPerFinancial.Value - _txtTotalLoanBalance.Value End If oConn.Close() End Sub
Where the expression on _txtTotalLoanBalance is = Sum(Fields.PctRiskTierGT1) , however rather than get the value that the expression brings, it incorporates _txtTotalLoanBalance.value as the string "= Sum(Fields.PctRiskTierGT1)" and it gets an error.
How can I get the value of this text box, or the value of Sum(Fields.PctRiskTierGT1) in the codebehind?