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

Dynamic creation of DBPipeLine

edited May 2003 in General
Hi,

How can a PipeLine created at Runtime visible to Report Builder. I'm trying
to create a PipeLine with the following code, the PipeLine is declared
public.

public
myDBPipeline1: TppDBPipeline;


myDBPipeline1 := TppDBPipeline.Create(Application);
myDBPipeline1.UserName := 'myPipeLine1';
myDBPipeline1.DataSource := DataSource1;
ppDesigner1.ShowModal;
myDBPipeline1.Destroy;

Thanks

-Jack

Comments

  • edited May 2003
    Hi Jack,

    see my comments inline ...


    public to what?


    never call method 'Destroy', use 'Free' instead!
    But if you pass an owner for the constructor then the owner is reponsible to free that component.
    Pass 'nil' when you may control the lifetime.
    Check property 'Visible' it should be 'True' by default.
    If you use the same form (as owner) for the report and the pipeline it should be visible.

    regards,
    Chris Ueberall;
  • edited May 2003
    Hi Chris,

    see my comments inline ...

    myDBPipeline1 := TppDBPipeline.Create(Form1);
    Assigning the form containing the ppReport as the Owner of the PipeLine did
    the trick

    It is True by default.

    Thanks

    -Jack
  • edited May 2003
    Jack,

    Here is a good example of how to create a complete report in code.

    http://www.digital-metaphors.com/tips/DynamicReportCreation.zip

    --
    Best Regards,

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

    That example is very good, except that the pipeline is created at design
    time.

    -Jack
  • edited May 2003
    Hi Jack,

    if there is a component created at design time and you need to create it at runtime then it is normally a simple task.
    Create the component and use the form as owner.
    Detect the parent from the component hierarchy in the DFM file (visual components only).
    Set all properties as found in the DFM file.
    That's it!

    regards,
    Chris Ueberall;
This discussion has been closed.