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

Variable in static text field

edited October 2007 in General
Is it possible to use inside of a text field a database variable?
e.g. You write: "Mr. is born ....
This should work with RB 7
Thank you for hints.
Nicolas

Comments

  • edited October 2007
    Hi Nicolas,

    You can access the current record of a db field using the
    Report.DataPipeline property. For instance, inside the OnGetText of a
    label...

    aText := 'Mr. " + Report.DataPipeline['MyField'] + ' is born...';

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2007

    Thank you, I the it with the End User Designer and it works.

    Regards
    Nicolas
  • edited October 2007
    > You can access the current record of a db field using the
    Meanwhile I found a strange problem:
    If I check in designmode it works. But if I open the report out of the
    program (e.g. on a click) all database fields are printed. The variable also
    but only the constant text, not the values of the database fields.
    Do you have a hint for me?
    Thank you and regards
    Nicolas
  • edited October 2007
    Hi Nicolas,

    If you are using a TppVariable, you should set it's value inside the OnCalc
    event. This is not a known issue with RB. Is there any Delphi event code
    being fired during runtime that could be causing this?

    As a test create a minimal application (form, report, button) and connect it
    to your dataset. Then place a variable in the detail band and implement the
    OnCalc in RAP as you have in your main app.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.