Click to See Complete Forum and Search --> : Changing a Formula Field in code


csillagyitzik
November 20th, 2009, 12:50 PM
Hi,
How can I change a Formula Field in code? I create a formula named "SD" that now has the following formula:
If 1=1 Then 'SD is 1'

I want to change it in code to: If 2=2 Then 'SD is 2'


I'm using VB .net and the CrystalDecisions.CrystalReports.Engine.ReportDocument object.
??? Help please

jggtz
November 20th, 2009, 02:41 PM
'CRReport --> Report object
'K --> Int variable

For K = 0 To CRReport.DataDefinition.FormulaFields.Count - 1
Select Case CRReport.DataDefinition.FormulaFields.Item(K).Name.ToString
Case "SD" : CRReport.DataDefinition.FormulaFields.Item(K).Text = "If 2=2 Then 'SD is 2'"
End Select
Next K

csillagyitzik
November 20th, 2009, 03:03 PM
Thanks!!!