0

My question relates to jasper server 3.71

How can I conditionally make an input control mandatory. I wish to force the user to select from one query or another. In my case they must select from a list of Divisions OR from a list of Clients.

With thanks

Mark

Mark
  • 1
  • 2

1 Answers1

1

This is not directly supported, however you could use a scenario where you define a third parameter which checks if either one or the other parameter is set. If the configuration is invalid you show an error message within the report instead of data.

Parameters:

  • parameter1, type: string, default value: none - deployed as input control
  • parameter2, type: string, default value: none - deployed as input control
  • verification, type: Boolean, default value: $P{parameter1} != null || $P{parameter2} != null - not deployed as input control

Band/Field Configurations:

  • As printWhen Expression of the detail band you add $P{verification} that means it will only be shown if the default expression for the verification parameter is true.
  • Define a text field in e.g. the title band giving an error message that either one of parameter1 and parameter2 need to be filled.
MrsTang
  • 3,119
  • 1
  • 19
  • 24