|
-
Aug 30th, 2012, 10:02 PM
#1
Thread Starter
Fanatic Member
Changing Crystal Report Font Programmatical
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?
-
Mar 18th, 2013, 07:13 PM
#2
New Member
Re: Changing Crystal Report Font Programmatical
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|