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

Hours and Minutes

edited March 2007 in General
Hi,

I have a decimal value that I would like to display in Hours and Minutes.
Also, I would like to sum the value and show the total.

What would be the best way of doing this in RB10?

Thanks in Advance.

Comments

  • edited March 2007
    Hi Jason,

    I would recommend converting your decimal number into a TDateTime type.
    From there you can alter the display format of the RB object to show the
    value exactly as you need.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2007
    That sounds ok, but I need to display it in hours and minutes, I am not able
    to show the days at all.
    Is this still possible if I convert it into time format?

    e.g: 100:20 for a hundred hours and twenty mintues.

  • edited April 2007

    Internally ReportBuilder calls Delphi's FormatDateTime function to format
    TDateTime data. See the Delphi online help for the FormatDateTime for
    details.

    I do not think there is a display format that will convert the days to
    hours, but you can easily write some code to do it. The Delphi DateUtils
    function contains a large collection of utility routines for date
    calculations.

    To perform custom formatting there are a couple of approaches:

    1. Use the DBText.OnFormat event

    2. Create a custom TppDisplayFormat descendant class and register it with
    RB. All formatting in ReportBuilder utilitizes TppDisplayFormat which is
    defined in ppDisplayFormat.pas.


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited April 2007
    Thanks Nard,

    I will have a look and see how it goes.

    Regards,
    Jason

This discussion has been closed.