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

setting ppDBPipeLine.MasterDataPipeline at runtime

edited November 2003 in General
I need to be able to define the sql queries at runtime, so
programaticaly create ppDBPipeLine-DataSource-DataSet component sets to
suit.

My reports contain subreports, requiring their own query.

I can manipulate ppDBPipeLine.MasterDataPipeline at designtime, but not
runtime as required. This property appears to be a pure placeholder
with a null getter and setter.

What do I need to do ?

Thanks in advance,

John Wilson

Comments

  • edited November 2003
    ---------------------------------------------------------
    Tech Tip: Define Master/Detail DataPipeline Links in Code
    ---------------------------------------------------------

    Defining a Master/Detail relationship for a DataPipeline
    requires that the detail pipeline have the
    following properties defined:

    1. MasterDataPipeline

    2. MasterFieldLinks


    At Delphi design-time you can use the object inspector
    and the DataPipeline's FieldLinks editor to define
    the master/detail relationship.


    The following example illustrates how to define the
    master/detail relationship dynamically at run-time.


    var
    lFieldLink: TppMasterFieldLink;


    begin

    {define the master/detail pipeline relationship}
    plDetail.MasterDataPipeline := plMaster;

    {create a new field link }
    lFieldLink := TppMasterFieldLink.Create(nil);

    lFieldLink.Parent := plDetail;

    {assign the detail field name}
    lFieldLink.DetailFieldName := 'CustNo';

    {assign the master field name}
    lFieldLink.MasterFieldName := 'CustNo';


    end;


    Note: The DataPipeline linking requires the records in the detail dataset to
    be ordered by the linking fields. In the above example, the detail data must
    be ordered by CustNo.


    --
    Best Regards,

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