Search code examples
crystal-reports

How to store variable in crystal report formula?


how to declare variables in crystal report ? coz i want to sum the total in sub-report and the total in the main-report to get the GRAND TOTAL of the report..i got a screenshot for my report...

enter image description here

i want to sum that 1000 which is the TOTAL in sub-report and that 808 total in the main report..how to do that in crystal report ? tnx in advance :)


Solution

  • You will need a formula in your sub-report that looks similar to the following:

    shared numbervar a := sum({yourfield});
    

    Place that somewhere on the canvas of your sub. Then another in your main report that looks like this:

    shared numbervar a;