Parsing Components in runtime loaded Report
hi all,
i search for a code snippet how to get access to all components in a
runtime loaded report.
For example
1. we are loading a report in rumtime
2. in Header Band we have for example a DPTeeChart in HeaderBand
3. i like to have access to this DPTeeChart
i tried:
procedure SetTChartDefaultSettings(Base: TComponent);
var
myEnum: TComponentEnumerator;
i: integer;
begin
for i := 0 to ppReportListenvorschau.HeaderBand.ComponentCount-1 do
begin
ShowMessage(ppReportListenvorschau.HeaderBand.Components[i].ClassName);
end;
if Assigned(Base) then
begin
myEnum:=Base.GetEnumerator;
end
else begin
myEnum := ppReportListenvorschau.GetEnumerator;
end;
while myEnum.MoveNext do
begin
ShowMessage(myEnum.GetCurrent.ClassName);
SetTChartDefaultSettings(myEnum.GetCurrent);
end;
end;
but i did not found any way to get a list of all components placed on
the report like Lable, Shape,DBText, DBTChart,....
we are using Delphi 2007, RP 12.04 Enterprise, TChart Pro V7.12
thanks for help
regards
daniel
--
--
Regards,
Daniel Magin
Embarcadero MVP
www.deltra.de
i search for a code snippet how to get access to all components in a
runtime loaded report.
For example
1. we are loading a report in rumtime
2. in Header Band we have for example a DPTeeChart in HeaderBand
3. i like to have access to this DPTeeChart
i tried:
procedure SetTChartDefaultSettings(Base: TComponent);
var
myEnum: TComponentEnumerator;
i: integer;
begin
for i := 0 to ppReportListenvorschau.HeaderBand.ComponentCount-1 do
begin
ShowMessage(ppReportListenvorschau.HeaderBand.Components[i].ClassName);
end;
if Assigned(Base) then
begin
myEnum:=Base.GetEnumerator;
end
else begin
myEnum := ppReportListenvorschau.GetEnumerator;
end;
while myEnum.MoveNext do
begin
ShowMessage(myEnum.GetCurrent.ClassName);
SetTChartDefaultSettings(myEnum.GetCurrent);
end;
end;
but i did not found any way to get a list of all components placed on
the report like Lable, Shape,DBText, DBTChart,....
we are using Delphi 2007, RP 12.04 Enterprise, TChart Pro V7.12
thanks for help
regards
daniel
--
--
Regards,
Daniel Magin
Embarcadero MVP
www.deltra.de
This discussion has been closed.
Comments
Take a look at the following article on how to loop through all
components on a report using a Report Object Loop.
http://www.digital-metaphors.com/rbWiki/Delphi_Code/Layouts/Report_Object_Loop
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
great stuff. That's what i am searching for!
Thanks for quick and perfect support !
--
--
Regards,
Daniel Magin
Embarcadero MVP
www.deltra.de