email me with any questions jonathan.phillips@bluespringsw.com
Public Sub LetsChangeTheFont()
Dim CrystalSections As Sections
Dim CrystalSection As Section
Dim CrystalReportObjects As ReportObjects
Dim CrystalFieldObject As FieldObject
Dim LoopCount As Integer
Set CrystalSections = Myreport.Sections
Set CrystalSection = CrystalSections(1) 'Report Header
Set CrystalReportObjects = CrystalSection.ReportObjects
For LoopCount = 1 To CrystalReportObjects.Count
If CrystalReportObjects.Item(LoopCount).Kind = crFieldObject Then
Set CrystalFieldObject = CrystalReportObjects.Item(LoopCount)
If CrystalFieldObject.Name = "Field1" Then
CrystalFieldObject.TextColor = vbRed
End If
End If
Next LoopCount
I am using this code to change the font based on the report name and text field. It Works!
Dim crobj As Object
With crReport.Sections.Item(3)
For Each crobj In .ReportObjects
If crobj.Name = FieldName Then
If FirstForm <> "Form1
FirstForm<> "Form2n
If IsNumeric(fieldData) Then
If crobj.Name = "fText35" Then
If fieldData > 999999 Then
crobj.Font.Size = "10.00"
End If
Else
If prtAuth = False Then
If fieldData >= 10000000 Then
crobj.Font.Size "11.00"
End If
End If
End If
End If
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.