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

Global constants

edited May 2004 in RAP
Is it possible to define global constants for RAP functions?
Somewhere where you can put something that all RAP see without defining
in each report (imagine you want do calculationl like : r * pi_greek and
you don't want to re-define pi_greek each time)?

Comments

  • edited May 2004
    Hi Nicola,

    Inside the treeview in the upper left hand corner of the Calc tab, if you
    right click and select "module" from the popup menu, you will get access to
    all the global options in RAP. From the Declarations section you could
    create any number of global constants or variables.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2004
    But are they global for every report?
    I thougt they are only for the report in which they reside...

  • edited May 2004
    Hi Nicola,

    Sorry, I must have missunderstood your first inquiry. RAP is designed to
    allow each report to be completely portable and independent of a reporting
    application. For this reason there is no such thing as an application
    global constant in RAP. You will need to use a constant created in Delphi
    to accomplish this.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2004
    Pardon me for joining in...


    Is there a way to add a function or global in Delphi code that can then be
    used in the SQL of the RAP dialogs? Basically, some means of setting a
    value that can be used in a comparison in the SQL is what I need.

    /Matthew Jones/
  • edited May 2004

    Some options:

    1. Create RAP pass-through functions that return Global values.

    2. Use a JITPipeline with each field in the JITPipeline representing a
    Global constant. Then you culd access these in RAP code or connect them to
    DBText etc. For example

    plGlobals['pi_Greek']

    3. In the Report.Template.OnLoadEnd event. Initialize the report with some
    Report.Parameters[]


    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.