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

TppDBText and the OnGetText event in code

edited September 2001 in General
hi,
i want to alter the representation of certain database fields based on the
content of another database field
i tried to do this in the fields of the dataset (OnGetText) but apparently
RB does not reference the Text of the field but rather the value
the question is where to code this changing of value the best
is the best place te OnGetText of the TppDBText object (wich sometimes gives
me a no current record error and crashes the exe)
or should i do this in RAP, when i do this in RAP how can i attach this
event to other TppDBText components on the same report
the code that has to be executed is the same (based on numbering of field in
the field name)
thx
marc

Comments

  • edited September 2001
    Use a TppVariable component and use its OnCalc event in RAP to grab the
    field value from the pipeline. Then if your condition is to change the text,
    you can do so in the OnCalc event, which should only fire once per data
    record. The OnGetText will fire every time the text property of the dbText
    is referneced, which is less efficient.

    Use TppVariables for each of the components in your report that should
    execute your formatting code. You could create a global function in RAP
    that would do this and inside all of your TppVariable.OnCalc event handlers
    call this function.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2001
    Jim,
    ok this seems a fair solution
    i'll try it out
    cu
    marc

This discussion has been closed.