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

Adjust captions of other items in OnGetText?

edited August 2002 in General
I have a ppDBText component on a report that has 2 ppLabels on the same
line and positioned just to the left of the ppDBText component. Looks
like this

ppLabel ppLabel ppDBText

In the OnGetText event of the ppDBText I need to check teh data field
and if it is negative I want to change the captions of the 2 preceding
labels as well as the format of the ppDBText. Can I do this?

Or am I better off to isolate the code changing the captions to the
OnGetText events of each of the captions?

I would prefer to keep the calculation/comparison code in one place for
maintenance reasons.

Other options would be to place the code in the OnTraversal event of the
Pipeline, or the OnPrint event of the band.

Comments?

Thanks,

Allen.

Comments

  • edited August 2002
    Use TppVariables instead of labels. Use the TppVariable's OnCalc event as
    this is the only event which is guaranteed to fire when you want it to
    (OnTraversal). The data pipeline's OnTraversal event may fire more than
    once per record, when the pipeline has to traverse forwards and backwards on
    a page break. The variable's calc timing for OnTraversal only fires when
    the pipeline moves forward in the dataset. You also want to use the
    CalcOrder property of the variables in order to have their OnCalcs fire in
    order. This gives some more options on how you want to calculate each
    value. If you want to locate all of the code in one place, then just use
    the OnCalc of one of the variables and set the other variables' Value
    property.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.