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

CrossTab - Percentages

edited May 2002 in General
Hi,

I need to convert the number values in a crosstab to percentages. Is this
possible just using RAP and not writing Delphi Code?

Currently I am using the OnCalcDimensionValue event to do the calculations.
I take the aValue and change it to a percent. I seem to get it kinda
working, but I now need to get the total number of records from my query.
How can I do that... This is an enduser report so I don't have the luxury of
using Delphi Objects here.

Thanks!

Dana

Comments

  • edited May 2002
    Make the report two pass. Define a global variable in ModuleView and use the
    crosstab's OnGetTotalValueText event to store the total value in that
    variable. During the second pass you'll have the total value available to
    calculate percentages in OnCalcDimensionValue. Make sure to perform those
    calculations only during the second pass of that event to avoid unnecessary
    work and division by zero errors. You can check the current pass by querying
    Report.FirstPass and Report.SecondPass Boolean values.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.