mysqldelphifastreportmydac

Delphi - MyDAC - Fast Report


I have no problem generating a report from a MySQL query or table. The problem starts when I want to add a variable in the report in each row.

For example, table "PRODUCTS": ID|PRODUCT-NAME|SHELF-LIFE

What's the best practice if I want to generate a report that shows me

ID | NAME | EXPIRE-DAY

Where: EXPIRE-DAY = TODAY + SHELF-LIFE

Thanks in advance for your help, even a link would be greatly appreciate.


Solution

  • Three Options:

    1. Use FR-functions to add your days.
    2. Use a variable in FR and calculate in Delphi via .OnGetValue-event
    3. Add the calculation of EXPIRE-DAY to your MySQL-Query

    something like:

    Select ID, NAME, SHELF-LIFE, DATE_ADD( CURDATE(), INTERVAL SHELF-LIFE DAY) as EXPIRE-DAY from mytable