Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

QReport - Beginner's question

When printing in QReports I want to make a field appear in normal text, underlined or bold depending on the value of another field in the table (not printed out in the report).

Anyone give me any pointers please.
0
DougBennett
Asked:
DougBennett
1 Solution
 
gaonaCommented:
Dear Doug  
 
The one that you want to do, is to change the source to be printed of a certain field of a table, when other field any has a certain value.  
If it goes only this, it is easy. You should make the following:  
1 - it tests the value of the field that will determine the type of the source used in the impression.  
2 - of acĂ´rdo with the found value, the source of the variable of the field to be printed, it will assume the following wanted value.  
Use the following code in its program:  
 
VarFonte -> Variable to be tested to determine the impression source.  
VarPrint -> Variable to be printed.  
 
if VarFonte=1 Then  
  VarPrint.Font.Style := [] {normal Impression}  
else if VarFonte=1 Then  
  VarPrint.Font.Style:=[fsBold] {Impression in Bold}  
else if VarFonte=2Then  
  VarPrint.Font.Style:=[fsUnderline]; {Impression Underline}  
   
I believe that this solves its problem.  
 
Regards  
 
Gaona

PS. - Sorry if my english is bad.
0
 
elkiorsCommented:
You need to have a look at the BeforePrint event for the band that contains the control you wish to change and add something like this to it.

if table1.fieldbyname('A String Field').Value='Male' then
begin
  qrlabelSex.Font.Style:=[fsBold,dsUnderline];
end
else
begin
  qrlabelSex.Font.Style:=[fsNormal];
end;
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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now