?
Solved

Urgent :  Macro subsitution

Posted on 2006-11-16
5
Medium Priority
?
196 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 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

762 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