Solved

QuickReport TQRExpr Control

Posted on 1997-07-08
2
990 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now