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

accesses to fields of database of RB designer

edited May 2008 in Datapipelines
Dear Sir,

I have RB10.08 pro. In Delphi 7 in windows XP.
I'd like accesses to fields of database of RB designer.For example:if
Title of persons is not "Manager" then invisible title in report.
Similar Similar: "ADOTable1.FieldByName('title').Asstring " for
ReportBuilder in RB designer.

Regards,

Ali Abbasi

Email: abbasi@sepehranformatic.com



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited May 2008
    Hi Ali,

    Your best option would be to use an event such as the DBText.OnPrint or
    Band.BeforePrint to determine the field value then toggle the visibility of
    the component based on that value. For instance...

    DBText.Visible := Report.DataPipeline['Title'] = 'Manager';

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2008
    Dear Nico,

    Thank you for your help.
    I wrote an application which users can change Templates of report in
    runtime and users maybe use from ppDBText1 or ppDBText2 or ppDBText23?
    for show Title.
    And with your solution I can only invisible for example DBText1 if I
    write below code:
    ppDBText1.Visible := ppReport1.DataPipeline['title'] = 'manager';
    I'd like if users when select each of ppDBText1 or ppDBText2 or
    ppDBText23? with field "title" and value of title are "manager" then RB
    10.08 pro. do invisible "title".

    Regards,

    Ali Abbasi

    visibility of



    --- posted by geoForum on http://delphi.newswhat.com
  • edited June 2008
    Hi Ali,

    In this case you can either loop through each component in the band, setting
    the visibility property of each or manually ses the visible property of each
    DBText.

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


    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2008
    Dear Nico,

    Thank you very much.
    I wrote some code similar your sample and fixed my problem.

    Regards,

    Ali Abbasi


    setting
    each
    object
    RB
    or
    example:if



    --- posted by geoForum on http://delphi.newswhat.com
This discussion has been closed.