Jump to content
We've recently updated our Privacy Statement, available here ×
  • Cascading (dependent) parameter values in JRXML are returning null values instead of default values


    abresci

    Issue:

    [toc on_off::hide=1]

    In my JRXML, I have one parameter (parameter bb) whose default value expression includes another parameter's (parameter aa) value. However, when I run the report, parameter bb does not return the value I expect based upon the value of parameter aa. What is causing this problem?


    Resolution:

    One typical cause of this is the order in which the parameters appear in your JRXML. This order is relevant. Dependent parameters should appear AFTER the parameters whose values are included in their default expressions. In the scenario above, parameter bb (the dependent, whose default value expression contains the value of parameter aa) should appear AFTER parameter aa. If you are using iReport, changing the order of parameters is as simple as opening your "Report Inspector" window (usually on the left), highlighting a parameter in your parameter list, and dragging it into its proper position in your parameter list.

    If you are running the report on JasperReports Server, there is the added issue of input controls. If you intend to have a parameter like parameter bb that is strictly dependent, and not intended to be manipulated directly by users running the report:

    1. Make sure the "use as prompt" property of the parameter is set to false
    2. Do not create an input control for that parameter in the report definition on the server

     


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...