Home Subreports

Keeptogether region calculates variable on calc twice

edited June 2003 in Subreports
I have a report with master data and a detail subreport. In the
detail band of that subreport I have a varialble.oncalc event
that has to accumulate and hence must only fire once.

I now need to keep that mast and detail together - so I put a
region on the master detail band and set keeptogether. However
now, when it has to throw a page to "keeptogether" it does my
subreport.detail.variable.oncalc twice and messes up
accumulation.

A common problem I know of finding an event that really fires
just once, a variable oncalc does - usually.

Can I keeptogether the master and detail without this problem?

Comments

  • edited June 2003
    Yes, the OnCalc will fire twice in this scenario. However, as long as you
    store the value in the variable's value parameter in the OnCalc, then it
    will be automatically restored when KeepTogether happens so that the second
    time the OnCalc fires, it will calculate based on if the previous OnCalc
    didn't take place.

    Are you using RB 7.02 for this report?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited June 2003
    I am using rb 7.02 ent. The problem is that I am using the variable simply to
    fire its oncalc - the oncalc programatically accumulates many non-report
    variables according certain criteria.

  • edited June 2003
    You'll have to store the values in TppVariables for it to work correctly.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.