Solved

Urgent :  Macro subsitution

Posted on 2006-11-16
5
192 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
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 …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

730 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