I use this code to change the font programmatically
Code:Dim newFont As New Font("Arial", 10, FontStyle.Bold) CType(.Section2.ReportObjects("TextBox1"), Object).Font = newFont
but the error is:
Property 'Font' is ReadOnly.
what should I do?
I use this code to change the font programmatically
Code:Dim newFont As New Font("Arial", 10, FontStyle.Bold) CType(.Section2.ReportObjects("TextBox1"), Object).Font = newFont
but the error is:
Property 'Font' is ReadOnly.
what should I do?
Dim fieldBox As FieldObject = cr.ReportDefinition.ReportObjects("FieldName")
fieldBox.Color = Color.Red
fieldBox.ApplyFont(New Font("Arial", 10, FontStyle.Bold))
crviewer.ReportSource = cr
Or, you can apply to TextObject:
Dim textBox As TextObject = cr.ReportDefinition.ReportObjects("TextObject1")
textBox.Color = Color.Red
textBox.ApplyFont(New Font("Arial", 10, FontStyle.Bold))
crviewer.ReportSource = cr