Solved

QuickReport TQRExpr Control

Posted on 1997-07-08
2
1,035 Views
Last Modified: 2013-11-22
Can anyone please give me an example of how to access the value of a TQRExpr in code. I need to check the expression result.
0
Comment
Question by:atkinslg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 1

Accepted Solution

by:
Zonnald earned 100 total points
ID: 1338489
atkinslg,

the TQREXpr has a OnPrint method.
You can look at the value (string) that is to be printed and using the val(String,Float,Result) procdure you can compare it to floating point values etc...
i.e.

Procedure myForm.myExprPrint(sender: TObject;
  var Value: String);
var tc : integer;
     Fval : Double;
begin
     val(Value,Fval,tc);  (* convert string to floating point *)
     if tc = 0 then          (* convert ok *)
        if checkthevalue(FVal) = resultNotOK then
           Value := '0';       (* or something *)
end;


Hows that?

Zonnald
             
0
 

Author Comment

by:atkinslg
ID: 1338490
An even better way is the one sent to me by Christopher Miller:

The "Value" property of a TQRExpr comonent is of type TQREvResult, which is
defined in qrprntr.pas.

You can check "Value.Kind" to see what the datatype is.  The following
table shows how to retrieve the results of the expression based on the
value of "Value.Kind"

   If Value.Kind = resInt then the results of the expression are in
Value.IntResult

   If Value.Kind = resDouble then the results of the expression are in
Value.DblResult

   If Value.Kind = resString then the results of the expression are in
Value.StrResult (defined as string[255])

   If Value.Kind = resBool then the results of the expression are in
Value.BooResult

   If Value.Kind = resError then the expression had an error

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question