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

Using as-of date for report calculations

edited December 2004 in End User

Hello geniuses-

My end-users need the ability to create fields that use the report
date, as-of date or system date in the calculations.
For example the data base has a name and birth date but they need
the age as-of the date of the report.

Report parameters seem made for this, but I get syntax errors
or wrong numbers in the result with all the options I tried.
Can't I simply assign a report parameter just before executing
the report explorer, so the end-user can access that value??
I have tried statements with variations for a variable on
the report, such as:

Value := Report.Parameters['ppAsOfParameter'];

Also I have tried accessing the system variable value for date
with no success.

(Using RB7.04. I have RB9 but have not worked out the Waler
devices and such yet - just haven't had the time, but would RB9
work better for this?)

TIA,
Scott Stalheim

Comments

  • edited December 2004

    1. RAP contains built-in functions for CurrentDate, CurrentDateTime and
    CurrentTime. Check out the Language tab of the RAP CodeToolbox. Under
    Function | DateTime.

    You can easily add more built-in functions and register them with the
    CodeToolbox. See the article below...

    2. You can also use Report.Parameters. Set the Parameter DataType to
    dtDatetime. You can set the parameter value via either Delphi code or RAP
    code. Use the syntax

    myReport.Parameters.Items['myParamName'].Value := somevalue;

    In RAP code, read-only access to the parameter values can be obtained using
    the following syntax.

    myVariable.Value := myReport.Parameters['myParamName'];

    In the above the datatype of myVariable should be DateTime as well.



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



    Best regards,

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