Solved

QReport - Beginner's question

Posted on 1998-10-24
2
254 Views
Last Modified: 2010-04-06
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
Comment
Question by:DougBennett
2 Comments
 

Accepted Solution

by:
gaona earned 50 total points
ID: 1344185
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
 

Expert Comment

by:elkiors
ID: 1344186
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

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

679 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