Problem about save more data pipelines
Hi,
I'm writing an application for design a report in runtime mode and external
to the my print server application.
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. I design my report for example with two data pipeline,
assign the first to dbtext1, the second to dbtext2, and save it.When I
reopen my report design i don't see the assignment of second pipeline but i
see only the main pipeline.
this is my code :
var
frm : TFrmDesigner;
rsMam : DbQuery;
rsDs : array of DbQuery;
rsPp : array of TppDbPipeline;
...
function ReportDesigner.loadDataSets() : boolean;
var
i : integer;
begin
i := 0;
rsMam := getCn().openQry(sqlDataSets,[getCprn()]);
rsMam.open;
frm.dsMAM.DataSource := rsMam.getDataSource();
while (rsMam.next()) do
begin
SetLength(rsDs,i + 1);
SetLength(rsPp,i + 1);
// ASSEGNO AD OGNI ELEMENTO DEL VETTORE RS IL CORRISPONDENTE SQLSTMT
rsDs[i] :=
getCn().openQry(StringReplace(upperCase(rsMam.getFieldByName('STMTSQL')),upperCase(':tabella^'),'TMPDESIGNER',[rfReplaceAll]),[]);
rsDs[i].open;
Result := rsDs[i].getError();
if (Result) then
exit;
// ASSEGNO AD OGNI PIPEILINE IL PROPRIO DATASOURCE
rsPp[i] := nil;
rsPp[i] := TppDbPipeline.Create(frm.ppRep.Owner);
rsPp[i].DataSource := rsDs[i].getDataSource();
rsPp[i].UserName := 'dbQuery'+IntToStr(i);
rsPp[i].OpenDataSource := True;
inc(i);
end;
end;
Could You help me?
Thank's,
Mauro
I'm writing an application for design a report in runtime mode and external
to the my print server application.
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. I design my report for example with two data pipeline,
assign the first to dbtext1, the second to dbtext2, and save it.When I
reopen my report design i don't see the assignment of second pipeline but i
see only the main pipeline.
this is my code :
var
frm : TFrmDesigner;
rsMam : DbQuery;
rsDs : array of DbQuery;
rsPp : array of TppDbPipeline;
...
function ReportDesigner.loadDataSets() : boolean;
var
i : integer;
begin
i := 0;
rsMam := getCn().openQry(sqlDataSets,[getCprn()]);
rsMam.open;
frm.dsMAM.DataSource := rsMam.getDataSource();
while (rsMam.next()) do
begin
SetLength(rsDs,i + 1);
SetLength(rsPp,i + 1);
// ASSEGNO AD OGNI ELEMENTO DEL VETTORE RS IL CORRISPONDENTE SQLSTMT
rsDs[i] :=
getCn().openQry(StringReplace(upperCase(rsMam.getFieldByName('STMTSQL')),upperCase(':tabella^'),'TMPDESIGNER',[rfReplaceAll]),[]);
rsDs[i].open;
Result := rsDs[i].getError();
if (Result) then
exit;
// ASSEGNO AD OGNI PIPEILINE IL PROPRIO DATASOURCE
rsPp[i] := nil;
rsPp[i] := TppDbPipeline.Create(frm.ppRep.Owner);
rsPp[i].DataSource := rsDs[i].getDataSource();
rsPp[i].UserName := 'dbQuery'+IntToStr(i);
rsPp[i].OpenDataSource := True;
inc(i);
end;
end;
Could You help me?
Thank's,
Mauro
This discussion has been closed.
Comments
- make sure you create the data components prior to loading the report.
- do the two pipelines appear the data tree?
- make sure that the ParentDataPipeline is set to False for the DBText
components that are connected to a datrapipeline from the
Report.DataPipeline.
- Rather than use your current approach, you might want to try using
DADE...Here is an example
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