Datapipeline dynamic creation
Hi,
I'm writing an application for design a report in runtime mode and external
to the my print server aplication.
I create with the class and not the visual component : dataset, datasource,
datapipeline.
I create with visual component report end designer.
I have to create dataset, datasource and datapipeline with the class because
I don't know how many dataset,datasource,
datapipeline I need. When I start the program in report design I don't see
the datapipeline that I created and assigned to
the report and so I can't assign any data to the dbtext, dbmemo, etc.
I think that your visual component set some hidden property to connect the
datapipeline and the report.
this is my code :
===========
.....
var
frmDesigner: TfrmDesigner;
idx: integer;
oqqREPORT: array [0..4] of TOraQuery;
oddsREPORT: array [0..4] of TOraDataSource;
pppdbQuery: array [0..4] of TppDBPipeline;
lDesigner: TppDesigner;
i: integer;
.....
idx := 0;
oqMAM.First;
while (not oqMAM.Eof) do begin
oqqREPORT[idx] := nil;
oqqREPORT[idx] := TOraQuery.Create(oqqREPORT[idx]);
oqqREPORT[idx].Session := osMAM;
(* creazione DataSource ORA *)
oddsREPORT[idx] := nil;
oddsREPORT[idx] := TOraDataSource.Create(oddsREPORT[idx]);
oddsREPORT[idx].DataSet := oqqREPORT[idx];
oqqREPORT[idx].SQL.Clear;
oqqREPORT[idx].SQL.Add(StringReplace(oqMAM.FieldByName('STMTSQL').AsString,':tabella^','TMPDESIGNER',[rfReplaceAll]));
oqqREPORT[idx].Active := True;
(* creazione Pipeline Report *)
pppdbQuery[idx] := nil;
pppdbQuery[idx] := TppDBPipeline.Create(pppdbQuery[idx]);
pppdbQuery[idx].DataSource := oddsREPORT[idx];
pppdbQuery[idx].UserName := 'dbQuery'+IntToStr(idx);
pppDbQuery[idx].OpenDataSource := True;
pppDbQuery[idx].Open;
pprReport.DataPipeline.a
inc(idx);
oqMAM.Next;
end;
pprREPORT.DataPipeline := pppdbQuery[0];
lDesigner := TppDesigner.Create(Self);
lDesigner.AllowDataSettingsChange := True;
lDesigner.Report := pprREPORT;
Legend :
======
oqMAM is an OracleQuery
My question is : is possible to do that or not ?
If is possible what is the property to set ?
Thank's in advance.
I'm writing an application for design a report in runtime mode and external
to the my print server aplication.
I create with the class and not the visual component : dataset, datasource,
datapipeline.
I create with visual component report end designer.
I have to create dataset, datasource and datapipeline with the class because
I don't know how many dataset,datasource,
datapipeline I need. When I start the program in report design I don't see
the datapipeline that I created and assigned to
the report and so I can't assign any data to the dbtext, dbmemo, etc.
I think that your visual component set some hidden property to connect the
datapipeline and the report.
this is my code :
===========
.....
var
frmDesigner: TfrmDesigner;
idx: integer;
oqqREPORT: array [0..4] of TOraQuery;
oddsREPORT: array [0..4] of TOraDataSource;
pppdbQuery: array [0..4] of TppDBPipeline;
lDesigner: TppDesigner;
i: integer;
.....
idx := 0;
oqMAM.First;
while (not oqMAM.Eof) do begin
oqqREPORT[idx] := nil;
oqqREPORT[idx] := TOraQuery.Create(oqqREPORT[idx]);
oqqREPORT[idx].Session := osMAM;
(* creazione DataSource ORA *)
oddsREPORT[idx] := nil;
oddsREPORT[idx] := TOraDataSource.Create(oddsREPORT[idx]);
oddsREPORT[idx].DataSet := oqqREPORT[idx];
oqqREPORT[idx].SQL.Clear;
oqqREPORT[idx].SQL.Add(StringReplace(oqMAM.FieldByName('STMTSQL').AsString,':tabella^','TMPDESIGNER',[rfReplaceAll]));
oqqREPORT[idx].Active := True;
(* creazione Pipeline Report *)
pppdbQuery[idx] := nil;
pppdbQuery[idx] := TppDBPipeline.Create(pppdbQuery[idx]);
pppdbQuery[idx].DataSource := oddsREPORT[idx];
pppdbQuery[idx].UserName := 'dbQuery'+IntToStr(idx);
pppDbQuery[idx].OpenDataSource := True;
pppDbQuery[idx].Open;
pprReport.DataPipeline.a
inc(idx);
oqMAM.Next;
end;
pprREPORT.DataPipeline := pppdbQuery[0];
lDesigner := TppDesigner.Create(Self);
lDesigner.AllowDataSettingsChange := True;
lDesigner.Report := pprREPORT;
Legend :
======
oqMAM is an OracleQuery
My question is : is possible to do that or not ?
If is possible what is the property to set ?
Thank's in advance.
This discussion has been closed.
Comments
- the Owner of the Report instance should be a Form or DataModule
myReport := TppReport.Create(myForm);
- then all other objects: Designer, DataPipelines, etc should have the same
Owner as the Report.Owner
myPipeline := TppDBPipeline.Create(myReport.Owner);
- a simpler approach to what you are doing, would be to use the DADE
architecture. Then you will have a TdaDataModule.DataViews[ ] composite in
which each of the DataViews is a container for the data access objects
(DataSets, DataSource, DBPipeline). Here is an example of using that
approach...
www.digital-metaphors.com/tips/CreateDataModCustOrderLinkedDataViews.zip
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com