Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

TppReport.FindUserObject NOT inside Subreports, why?

edited April 2003 in General

I need to know if a object named 'ausername' exists inside a loaded report
template, and I've seen that TppReport.FindUserObject(ausername: string)
method tries to find the 'ausername' object inside the 'self' report, its
bands and its groups, but it doesn't look for the 'ausername' object inside
its subreports, why?

Therefore, I've been obligated to make a recursive procedure that tries to
find the object into the report and its subreports.

Why does not the TppReport.FindUserObject(ausername: string) method
accomplish with that mission? Is an error or it has been designed as is?

Francisco Irles
Computer Elche, S.L.

Comments

  • edited April 2003
    Francisco,

    Try using a report object loop as described in the article below.

    ----------------------------------------------
    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;

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.