Home RAP

Global variables do not work

edited May 2015 in RAP

Global variables simply do not seem to work in RB 14, Delphi 2009.

I have some TppVariables declared in the global declarations, I create them in the global OnCreate and I assign some values in OnGetAutoSearchValues. By the time BeforeOpenDataPipelines is called, the values are blank.

I also tried using standard TDateTime / String variables (not TppVariables) and get the same problem. It's like the variables are re-initialised before BeforeOpenDataPipelines. This makes passing values into that procedure impossible!


Steve Branley

--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-


  • edited May 2015
    Hi Steve,

    If you are tying to simply hold values, there should be no reason to
    create full TppVariable components. Simply use a global declaration

    If you would like to create TppVariable components in RAP, you should do
    so in the Band.BeforePrint event and properly assign its Band property.

    I created a simple test that creates a string value in the global
    declarations of RAP. I then assigned its value in the Global OnCreate
    to the value "Test". I was able to successfully access the correct
    value using a ShowMessage() call in the OnGetAutoSearchValues event when
    running the report.

    Best Regards,

    Nico Cizik
    Digital Metaphors
This discussion has been closed.