Solved

Urgent :  Macro subsitution

Posted on 2006-11-16
5
190 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

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
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.

759 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