Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

QuickReport TQRExpr Control

Posted on 1997-07-08
2
Medium Priority
?
1,091 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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses
Course of the Month20 days, 18 hours left to enroll

810 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