Solved

QReport - Beginner's question

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

17 Experts available now in Live!

Get 1:1 Help Now