Solved

Urgent :  Macro subsitution

Posted on 2006-11-16
5
191 Views
Last Modified: 2010-04-04
hi
how can I do the following

example:
   i am using quick report , the are 20 QrDbtext (  QrDbtext1,QrDbtext2,QrDbtext3 ........QrDbtext31 )  on the quick report that represented the days in the month ,
I want if the day of the month in FRIDAY i want to change the color or QrDbtext?  ...

like this
ex:
MMon := 11;
Days := 30;
for k := 1 to Days do
begin
   xdate := IntToStr(k)+'/'+IntToStr(mmon)+'/'+'2006';
   IF DayOfTheWeek(StrToDate(xdate)) = 5 then
        Qreport1.QrDbText.... .Color := clSilver;
end;
 
best regards
0
Comment
Question by:hetturki
  • 2
5 Comments
 
LVL 10

Expert Comment

by:atul_parmar
ID: 17954583
var
  dd, mm, yy : word;
  dt : tdate;
  i : integer;
begin
  mm := 11;
  dd := 30;
  yy := 2006;
  for i := 1 to dd do
  begin
    dd := EncodeDate(yy, mm, dd);
    if DayOfTheWeek(StrToDate(xdate)) = 5 then
        // set the color e.g. Qreport1.QrDbText.font.color := clSilver
  end;
end;
0
 

Author Comment

by:hetturki
ID: 17954836
Sorry ! I think you dont understand my quetion
I need the following

 Qreport1.QrDbText1.color := clSilver;
 Qreport1.QrDbText2.color := clSilver;
..
..
...
...
 Qreport1.QrDbText20.color := clSilver;

i want do this with one statement

0
 
LVL 10

Accepted Solution

by:
atul_parmar earned 500 total points
ID: 17954883
I don't have the Quickreport installed so can not give you the working code. however, the idea is

put the above code in beforerender / beforepaint event of the dbtext and assign the same event to all dbtext1..dbtext20

(sender as TQrDbText).font.color := clSilver;

OR

var
  i : integer;
begin
  for i := 0 to Qreport1.ControlCount - 1 do
    if Qreport1.Controls[i].Name >= 'QrDbText1' and Qreport1.Controls[i].Name  <= 'QrDbText20' then
       (Qreport1.Controls[i] as TDBText).font.color := clSilver;
end;
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21133160
Forced accept.

Computer101
EE Admin
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

Title # Comments Views Activity
loading dll from external path 1 210
How to use Hashing sha1 in Delphi 2010 4 199
TVirtualStringTree  search using TEdit 7 106
Delphi: how to send PJL commands to printer 3 89
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…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

919 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

18 Experts available now in Live!

Get 1:1 Help Now