Jump to content
JasperReports Library 7.0 is now available ×
  • How to sum return values from multiple subreport at various levels

    • Version: v7.1 Product: JasperReports® Library

    Issue Description

    Subreports can return values to a main report's variables but using a variable whose value is returned from a subreport (or a subdataset) to define another variable's value does not generally work because the calculation engine (which computes regular variable values) and the subreport execution are de-phased. Regular variable values are computed before the detail band is rendered, and at that moment the subreport has not yet been executed and the value has not been fed to the variable.


    An design approach needing to sum return values from various subreport levels is to use several return values with calculation=Sum and target variables with reset types. See an example attached in Sample1.zip which you can run with 10 empty records, for example set the query to

    Ref. Case 01523249


    User Feedback

    Recommended Comments

    There are no comments to display.

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

  • Create New...