unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
DB, DBTables, FR_DSet, FR_DBSet, FR_Class, StdCtrls, ADODB;
type
TForm1 = class(TForm)
frReport1: TfrReport;
frDBDataSet1: TfrDBDataSet;
DataSource1: TDataSource;
Button1: TButton;
ADOConnection1: TADOConnection;
ADODataSet1: TADODataSet;
ADODataSet2: TADODataSet;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
if ADODataSet1.Active then
ADODataSet1.Close;
ADODataSet1.CommandText:='select * from employee where fname=''helen'' ';
ADODataSet1.Open;
DataSource1.dataset:=ADODataSet1;
frReport1.LoadFromFile('mytest.frf');
frReport1.PrepareReport;
frReport1.ShowReport;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if ADODataSet2.Active then
ADODataSet2.Close;
ADODataSet2.CommandText:='select * from employee where fname=''pedro'' ';
ADODataSet2.Open;
DataSource1.dataset:=ADODataSet2;
frReport1.LoadFromFile('mytest.frf');
frReport1.PrepareReport;
frReport1.ShowReport;
end;
end.