Method Community

 

Report Designer: Syntax to change field to Bold

Last post 08-20-2015 3:00 PM by robert.cowart. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-20-2015 12:14 PM

    Report Designer: Syntax to change field to Bold

    I have a Customer field in my report I want to Bold in my "before print" script event.  What is the syntax to change my Customer field to bold?  I can't use the build in conditional formatting because there are other things I am doing in this "before print" logic.  Thanks!

  • 08-20-2015 3:00 PM In reply to

    Re: Report Designer: Syntax to change field to Bold

    Figured it out.  Wish I had a year ago...

    BEFORE PRINT EVENT
    ' determine if this Sales Order is new or recently changed
    dim SOTxnDate as date = cdate(TxnDate.text)
    if Microsoft.VisualBasic.DATEDIFF("d", SOTxnDate, DateTime.Now) <= 2 and _
      Microsoft.VisualBasic.Weekday(Datetime.Now) >= 5 then
      ' only use bold, red and upper Thursday and Friday.
      Customer.Text = Customer.Text.ToUpper
      Customer.Font = New Font(Customer.Font, FontStyle.Bold)
      Customer.ForeColor = Color.Red
    end if
    AFTER PRINT EVENT
    ' set it back to normal font
    Customer.Font = New Font(Customer.Font, FontStyle.Regular)
    Customer.ForeColor = Color.Black
Page 1 of 1 (2 items)