Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Question about how to correctly make the total sum

edited June 2003 in General
Hi,

i have the following problem:
In the detail band a report i display (among other fields) a custom calculated field - the value of this field is calculated for
every record displayed in the detail band.
Example: the report is bind to a TppDBPipeline which has the source bind to a table "A", and for each record displayed (from table
A) i have to make the above mentioned calculation which involves the use of another table, which isn't in relationship with table A.
(I'm explaining this because if it was in relationship, maybe i could solve the problem).

The problem is that i have to make a total sum of the calculated fileld at the end of the report and i don't know how to obtain it(i
can't use a DBCalc component). I tried to use a variable which contains the sum of the calculated fileds already displayed (in i
handle this in the OnCalc event of the calculated field). This works fine if i go straight to the end of the report. But if i don't,
the sum is not correct, because for each time a page is diplayed the sum is recalculated. (e.g. if i have a report of four pages and
the subtotal of the calculated field on both four pages is 5, then the total sum should be 20. But if i scroll the pages in the
following order 1->2->3->2->3->4 the total sum is 6*5 = 30 and not 20!! (because i displayed pages 2 and 3 twice)).

Does anyone have any suggestion on how to solve this problem?

Thanx

Comments

  • edited June 2003
    Jure,

    Try setting the Report.CachePages property to True while using the Variable
    method you described below. This should resolve your issue without any
    changes to your existing report.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.