Solved

QReport - Beginner's question

Posted on 1998-10-24
2
251 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

13 Experts available now in Live!

Get 1:1 Help Now