KB-32398: Changing a report’s row color according to a field’s value.

Question:

How can I change a row’s color when printing a report according to a field’s value?

Solution:

To do so, add a script to report’s OnFormat event to check the field’s Text property. For example:

Sub OnFormat

Set Detail = Report.Sections(“Detail”)
Set Field2 = Detail.Controls(“Field2”)

If Field2.text > 50 then
Field2.ForeColor = RGB(255,0,0)
Else
Field2.ForeColor = RGB(0,0,0)
End if

End Sub

See attached demo application.

Attachments:

ChangeReportSettingsOnFormat

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *