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

Converting DBCalc output

edited July 2008 in General
?Hello Everyone, im connecting to a database and im using a DBCalc to
get the average of a column. I want to also convert this into hrs/mins
I have two other variables that are doing this but it won't let me use
the Value:= command when coding for a DBCalc or maybe im just doing it
wrong :)

Here is my code for the variables

var
hours: Integer;
mins: Integer;
hours_label : String;
mins_label: String;
mins_prefix: String;

begin
hours := RV_CALL['Call_Downtime'] div 60;
mins := RV_CALL['Call_Downtime'] mod 60;

if hours = 1 then hours_label := ' hr '
else hours_label := ' hrs ';

if mins = 1 then mins_label := ' min'
else mins_label := ' mins';

if mins < 10 then mins_prefix := ''
else mins_prefix := '' ;

if mins < 0 then
mins := -mins;

Value := IntToStr(hours) + hours_label + mins_prefix + IntToStr(mins)
+ mins_label;

end;



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited July 2008

    Please configure your newreader to show your real name when posting, rather
    than 'asmith'

    Please always specify Delphi version, RB version, Windows version, data
    access environment.

    The sampl code does not show from which event-handler the code is being
    executed. Provide more details.



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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2008
    Sorry Nard,

    Not sure on the delphi version?

    Report Builder Version 9.03
    Windows XP
    Oracle Database

    I am using the OnCalc event for a DBCalc operator.

    I actually got the code to work using the above syntax but taking out

    Value :=

    and putting ShowMessage,

    My question now is, how do I make the information print to the report
    view rather than to a ShowMessage box, im pretty new to Delphi and just
    shooting from the hip to complete these reports. Any help is
    appreciated.



    --- posted by geoForum on http://delphi.newswhat.com
  • edited July 2008
    Please configure your newreader to show your real name when posting, rather
    than 'asmith'


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2008
    Not sure on the Delphi version? Are you a Delphi developer?

    -----------------------------------------
    Article: End-User Tech Support
    -----------------------------------------

    Please understand that Digital Metaphors can only provide tech support to
    the Delphi developers that purchase ReportBuilder. Digital Metaphors
    receives no distribution royalties from Delphi developers that embed
    end-user reporting solutions in their applications. It is the responsibility
    of the software publishers that sold you the product to provide you with
    tech support.

    There is an end-user tutorial called Learning ReportBuilder that can be
    downloaded from our web site for free. See the following article for more
    infomation.

    --------------------------------
    Article: Learning ReportBuilder
    --------------------------------

    Learning ReportBuilder is a complete learning system designed to teach end
    users how to build a range of reports. This system includes a 125-page PDF
    file, a stand-alone application complete with a database, and a help file.
    The PDF file is comprised of a series of tutorials that step end users
    through the process of building reports as simple as a table listing and as
    complex as crosstabs. The tutorials also introduce conceptual aspects of
    report building along the way. The application is used in conjunction with
    the tutorials so that the learning experience is interactive. The end user
    just prints out the PDF file, runs the application, and learns
    ReportBuilder. The help file is accessible from the application, so all
    three tools work together to provide a seamless learning environment.

    Learning ReportBuilder installs into C:\Program Files\LearnReportBuilder.
    When the system has successfully installed, a complete set of instructions
    appears in the form of a 'ReadMe' doc, so the end user knows just what to do
    upon installation.

    - Download Learning ReportBuilder

    http://www.digital-metaphors.com/LearnRB/LearnRB.exe



    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2008
    I didn't realize this was a tech support forum, I was just trying to
    find someplace to go for help because I can't find help anywhere else.
    How much would it be for a forum support contract?



    --- posted by geoForum on http://delphi.newswhat.com
  • edited July 2008
    Please configure your newreader to show your real name when posting. Please
    do not continue to ignore this request. It is not optional.

    At this time, we only support the Delphi developers that purchase a license
    to ReportBuilder. All of our tech support assumes customers are programmers
    that know the Delphi environment. ReportBuilder is written in Delphi and
    leverages the Delphi VCL class library.


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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2008
    I change my name in the "Your Data" option on this site, im not sure if
    its going to apply right now or not but I did change it.

    How much is a ReportBuilder License only, I don't need the software.



    --- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.