C
citybug_ch
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, FR_DSet, FR_DBSet, FR_Class, DB, ADODB, StdCtrls, FR_Rich, FR_View;
type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
ADOConnection1: TADOConnection;
Memo2: TMemo;
Memo3: TMemo;
frReport1: TfrReport;
frDB1: TfrDBDataSet;
BaseQuery: TADOQuery;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
strsql: string;
ADOQuery: TADOQuery;
i: integer;
fr: TFrReport;
frDB1,frDB2,frDB3:TFrDBDataSet;
BaseQuery,PassedQuery,UnPassQuery: TADOQuery;
frRichObject1:TfrRichObject;
begin
Fr:=TFrReport.Create(self);
Fr.PreviewButtons:=[pbPrint, pbExit];
frRichObject1:=TfrRichObject.Create(nil);
FrDB1:=TFrDBDataSet.Create(nil);
FrDB2:=TFrDBDataSet.Create(nil);
FrDB3:=TFrDBDataSet.Create(nil);
BaseQuery:=TADOQuery.Create(nil);
BaseQuery.Connection :=ADOConnection1;
PassedQuery:=TADOQuery.Create(nil);
PassedQuery.Connection :=ADOConnection1;
UnPassQuery:=TADOQuery.Create(nil);
UnPassQuery.Connection :=ADOConnection1;
frDB1.DataSet :=BaseQuery;
frDB2.DataSet :=PassedQuery;
frDB3.DataSet :=UnPassQuery;
fr.Dataset :=frDB1;
ADOQuery:=TADOQuery.Create(nil);
strsql:='select sqlstr from reportsql where ReportID=''0000000015''';
ADOQuery.Connection :=self.ADOConnection1 ;
ADOQuery.SQL.Text :=strsql;
ADOQuery.open ;
for i:=0 to ADOQuery.RecordCount -1 do
begin
case i of
0:
begin
BaseQuery.SQL.Text :=ADOQuery.fieldByName('sqlstr').AsString + '''' + '0000000046' + '''';
BaseQuery.Open ;
memo1.Text :=BaseQuery.SQL.Text;
end;
1:
begin
PassedQuery.SQL.Text :=ADOQuery.fieldByName('sqlstr').AsString + '''' + '0000000046' + '''';
PassedQuery.Open ;
memo2.Text :=PassedQuery.SQL.Text;
end;
2:
begin
UnPassQuery.SQL.Text :=ADOQuery.fieldByName('sqlstr').AsString + '''' + '0000000046' + '''';
UnPassQuery.Open ;
memo3.Text :=UnPassQuery.SQL.Text;
end;
end;
ADOQuery.Next ;
if ADOQuery.eof then break;
end;
fr.LoadFromFile('BespokeNotice.frf');
fr.PrepareReport ;
fr.ShowReport ;
fr.Free ;
end;
end.
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, FR_DSet, FR_DBSet, FR_Class, DB, ADODB, StdCtrls, FR_Rich, FR_View;
type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
ADOConnection1: TADOConnection;
Memo2: TMemo;
Memo3: TMemo;
frReport1: TfrReport;
frDB1: TfrDBDataSet;
BaseQuery: TADOQuery;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
strsql: string;
ADOQuery: TADOQuery;
i: integer;
fr: TFrReport;
frDB1,frDB2,frDB3:TFrDBDataSet;
BaseQuery,PassedQuery,UnPassQuery: TADOQuery;
frRichObject1:TfrRichObject;
begin
Fr:=TFrReport.Create(self);
Fr.PreviewButtons:=[pbPrint, pbExit];
frRichObject1:=TfrRichObject.Create(nil);
FrDB1:=TFrDBDataSet.Create(nil);
FrDB2:=TFrDBDataSet.Create(nil);
FrDB3:=TFrDBDataSet.Create(nil);
BaseQuery:=TADOQuery.Create(nil);
BaseQuery.Connection :=ADOConnection1;
PassedQuery:=TADOQuery.Create(nil);
PassedQuery.Connection :=ADOConnection1;
UnPassQuery:=TADOQuery.Create(nil);
UnPassQuery.Connection :=ADOConnection1;
frDB1.DataSet :=BaseQuery;
frDB2.DataSet :=PassedQuery;
frDB3.DataSet :=UnPassQuery;
fr.Dataset :=frDB1;
ADOQuery:=TADOQuery.Create(nil);
strsql:='select sqlstr from reportsql where ReportID=''0000000015''';
ADOQuery.Connection :=self.ADOConnection1 ;
ADOQuery.SQL.Text :=strsql;
ADOQuery.open ;
for i:=0 to ADOQuery.RecordCount -1 do
begin
case i of
0:
begin
BaseQuery.SQL.Text :=ADOQuery.fieldByName('sqlstr').AsString + '''' + '0000000046' + '''';
BaseQuery.Open ;
memo1.Text :=BaseQuery.SQL.Text;
end;
1:
begin
PassedQuery.SQL.Text :=ADOQuery.fieldByName('sqlstr').AsString + '''' + '0000000046' + '''';
PassedQuery.Open ;
memo2.Text :=PassedQuery.SQL.Text;
end;
2:
begin
UnPassQuery.SQL.Text :=ADOQuery.fieldByName('sqlstr').AsString + '''' + '0000000046' + '''';
UnPassQuery.Open ;
memo3.Text :=UnPassQuery.SQL.Text;
end;
end;
ADOQuery.Next ;
if ADOQuery.eof then break;
end;
fr.LoadFromFile('BespokeNotice.frf');
fr.PrepareReport ;
fr.ShowReport ;
fr.Free ;
end;
end.