Linking subreports in iReport so they also work in Jasper server

后端 未结 1 878
名媛妹妹
名媛妹妹 2021-02-03 10:37

Using iReport v4.0.1 with Jasperserver v4.1.0 I\'m trying to find a syntax for linking subreports to the main report that lets me test it in iReport then deploy to the server th

相关标签:
1条回答
  • 2021-02-03 11:09

    The best solution to this is to add an additional parameter like $P{IsOnServer}. Set the default value to true. For your subreport expression use this:

    $P{IsOnServer} ? "repo:mySubReport.jrxml" : "/local/path/to/mySubReport.jasper"
    

    When you run the report in iReport, you'll be prompted for the value of IsOnServer. Make it false; the subreport expression will resolve to your local file. On the server, don't define an input control. The users will never be prompted for that parameter (they won't even know it exists), and it will result to the desired 'repo' syntax.

    An even better solution would of course be for iReport to handle this automatically... but for now you need to do something like this.

    0 讨论(0)
提交回复
热议问题