On the From the three queries, respectively is Adoquery1, Adoquery2, Adoquery3
Data sets, and then put the three financial statements that were frxDBDataset1, frxDBDataset2, frxDBDataset3
Three query corresponding to their data sets, such as Adoquery1 corresponding frxDBDataset1...
Then put a DataSource1, the Dataset is set to Adoquery1
On the report put the three MasterData, respectively corresponding to the three data sets, such as MasterData1 corresponding frxDBDataset1...
I just want the three views according to the query conditions in the FORM shown in the report of the three data area,
But why I feel the second report, the three data sets show that is not normal, if you have several statements also complains?
//purchase amount
If (pub. Rids=11) then
The begin
With ADOQuery1 do
The begin
The Close;
SQL. The Clear;
SQL. Add (' select * from PurCost1View where 1 & lt;> 2 ');
If the Trim (ReportNo. Text) & lt;> "' then
SQL. The Add (' and ReportNo='" + Trim (ReportNo. Text) + "' ");
The Open;
If RecordCount & gt; 0 then
The begin
Update FR {source}
FrxDBDataset1. FieldAliases. The Clear;
FrxDBDataset1. FieldAliases. BeginUpdate;
end;
end;
With ADOQuery2 do
The begin
The Close;
SQL. The Clear;
SQL. Add (' select * from PurCost2View where 1 & lt;> 2 ');
If the Trim (ReportNo. Text) & lt;> "' then
SQL. The Add (' and ReportNo='" + Trim (ReportNo. Text) + "' ");
The Open;
If RecordCount & gt; 0 then
The begin
Update FR {source}
FrxDBDataset2. FieldAliases. The Clear;
FrxDBDataset2. FieldAliases. BeginUpdate;
end;
end;
With ADOQuery2 do
The begin
The Close;
SQL. The Clear;
SQL. Add (' select * from PurCost3View where 1 & lt;> 2 ');
If the Trim (ReportNo. Text) & lt;> "' then
SQL. The Add (' and ReportNo='" + Trim (ReportNo. Text) + "' ");
The Open;
If RecordCount & gt; 0 then
The begin
Update FR {source}
FrxDBDataset3. FieldAliases. The Clear;
FrxDBDataset3. FieldAliases. BeginUpdate;
end;
end;
end;
If (pub. Rids=10) then
FileStr:=ExePath + 'Report \ PurQty fr3'
The else
FileStr:=ExePath + 'Report \ PurCost fr3';
If FileExists (fileStr) then
The begin
Try
FrxReport1. LoadFromFile (fileStr);
FrxReport1. Report. PrepareReport;
FrxReport1. Report. ShowPreparedReport;
Except,
end;
end;
CodePudding user response:
Screenshot to see bai
CodePudding user response:
Two query2 and no query3