Results 1 to 2 of 2

Thread: Changing Crystal Report Font Programmatical

  1. #1
    Fanatic Member
    Join Date
    Oct 06
    Posts
    650

    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?

  2. #2
    New Member
    Join Date
    Mar 13
    Posts
    1

    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
  •