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

How access pipeline from loaded report ?

edited August 2002 in General
I load report from database and I need access dataset for one table. How
can do this ?

I try TppDataPipelineList.Create(Report_Sys) but It return only one
pipeline and if I try to set filter is ignored in the report execution.

Sample code
-------------
Report_Sys.Template.LoadFromDatabase;
PipeLineList := TppDataPipelineList.Create(Report_Sys);

--
Philippe Constant
CTRL/Informatique
350 Rue Franquet, bureau 50
Ste-Foy, Qc
G1P 4P3

Comments

  • edited August 2002
    I assume you are using DADE, in which case the composite is:

    [Report[DataModule[DataView[DataPipeline]]]]

    So you need to extract the DataModule first. There is a DADE function that
    does this:

    uses
    daDataModule, daDataView, daDB;

    procedure TForm1.GetDataPipelinesOutOfDataModule;
    var
    lDataModule: TdaDataModule;
    lDataView: TdaDataView;
    lDataPipeline: TppDataPipeline;
    liIndex: Integer;
    lDataPipelines: TList;
    begin

    lDataPipelines := TList.Create;

    {get the datamodule}
    lDataModule := daGetDataModule(aReport);

    if (lDataModule <> nil) then
    begin
    for liIndex := 0 to lDataModule.DataViewCount - 1 do
    begin
    lDataView := lDataModule.DataViews[liIndex];

    lDataPipeline := lDataViews.DataPipelines[0];

    lDataPipelines.Add(lDataPipeline);
    end;
    end;

    {do something interesting with lDataPipelines here}

    end;

    Once you have the data module, you can loop through it's DataView array
    property and retrieve the DataViews. QueryDataViews (which are created by
    the Query Designer and Query Wizard) have only one data pipeline, so you can
    easily retrieve this from the first position of the DataPipelines array
    property.

    --
    Cheers,

    Tom Ollar
    Digital Metaphors Corporation
This discussion has been closed.