Can I use the Username instaed Name.
I need to change the caption of the label at runtime, where the name of the
label defined in the reports is ppLabel1 and the username is FromDate,
TppFooterBand(FindComponent('ppLabel1')).Caption := '01/04/2003'
I need to use the username instaed the name property. Can I ? if so, how
should it be done ?
Thanks in Advance
Moorthy
~~~~~~
label defined in the reports is ppLabel1 and the username is FromDate,
TppFooterBand(FindComponent('ppLabel1')).Caption := '01/04/2003'
I need to use the username instaed the name property. Can I ? if so, how
should it be done ?
Thanks in Advance
Moorthy
~~~~~~
This discussion has been closed.
Comments
full control over what you are looking for. See the tech-tips newsgroup for
an article describing this technique. It should be located in the Code Based
thread of that newsgroup.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
for i := 0 to ComponentCount - 1 do
if (Components[i] is TppLabel) then
begin
if (Components[i] as TppLabel).UserName = 'Label6' then
(Components[i] as TppLabel).Caption := _FromDATE;
if (Components[i] as TppLabel).UserName = 'Label8' then
(Components[i] as TppLabel).Caption := _ToDATE;
end;
But I thought this is too lengthy ! thats why I opt for a shoter
solution. Also there is no "Code Based" thread in the tech-tips news-group.
Thanks.
----------------------------------------------
Tech Tip: Loop Thru All Objects in a Report
---------------------------------------------
A ReportBuilder report is composed of a set
of components. The basic structure is
Reports.Bands[].Objects[]
The bands and objects within the report can
be accessed directly by object name or
via the Bands and Objects array properties.
Below is an example of using the Bands and
Objects array properties to change the font for
all objects on a report.
uses
ppClass;
procedure AssignFontToReport(aFont: TFont; aReport: TppCustomReport);
var
liBand: Integer;
liObject: Integer;
lObject: TppComponent;
begin
for liBand := 0 to aReport.BandCount-1 do
for liObject := 0 to aReport.Bands[liBand].ObjectCount-1 do
begin
lObject := aReport.Bands[liBand].Objects[liObject];
if lObject.HasFont then
lObject.Font := aFont;
end;
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Can u please tell me how to set my newsreader to read older messages, Im
using Outlook Express and could'nt figure out how that can be done.
Sorry ! If Im going little out of the way. Thanks.
saying Delete news message [5] days after being downloaded. Uncheck this
and redownload the tech-tips newsgroup. That should do the trick.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com