/ Help centre
← All articles
End Users › General

How can I change the visibility of fields on a report based on the value of a Parameter?

Applicable Versions: All Versions Sometimes you might want to show of hide a field on your report based on the value of an parameter. This can be achieved by adding the parameter to the report's Page Header then adding some script to the OnFormat event of the report Detail section This script…

Updated 11 April 2018

Applicable Versions: All Versions


Sometimes you might want to show of hide a field on your report based on the value of an parameter.


This can be achieved by adding the parameter to the report's Page Header then adding some script to the OnFormat event of the report Detail section 


This script will hide the CustomerName field if the Country parameter is ""France"".


Sub OnFormat

  IF Rpt.Sections.item("PageHeader").Controls("Country").text = "France" then

     Rpt.Sections.item("Detail").Controls.Item("CustomerName ").visible = False

  Else

     Rpt.Sections.item("Detail").Controls.Item("CustomerName ").visible = True

  End if

End Sub

Need a hand?

We’re here if you need a little more help.

Contact support ↗