Solved

QuickReport TQRExpr Control

Posted on 1997-07-08
2
1,004 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
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…

776 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