Jump to content
We've recently updated our Privacy Statement, available here ×
  • How to sum return values from multiple subreport at various levels


    ghudson_1
    • 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.


    Resolution

    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

    sample1.zip


    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...