Home > Back-end >  How about FastReport statements, there are three MastData design?
How about FastReport statements, there are three MastData design?

Time:11-22

Is that there are three views, after points according to the query conditions present in the report...

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 . Fastreport I spent so many years I haven't updated data set manually, set up the dataset associated with the query, and design the report when the load data, query came close to open the data; Where 1 & lt;> 2 conditions is good-looking? ; There is no connection between the three tables? Have associated with a query can connect came in, no connection is built three statements,
  • Related