inmydata developers portal

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

Modified on Wed, 11 Apr, 2018 at 12:42 PM

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.

Leave a message Contact support