unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Grids, DBGrids, ExtCtrls, DBCtrls, StdCtrls, Mask,
Db, ADODB, DBTables;
type
TForm1 =
class(TForm)
ADOConnection1: TADOConnection;
DataSource1: TDataSource;
ADOTable1: TADOTable;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
DBNavigator1: TDBNavigator;
DBGrid1: TDBGrid;
Button1: TButton;
Button2: TButton;
Button3: TButton;
DBEdit3: TDBEdit;
ADOQuery1: TADOQuery;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
Var
Form: TForm2;
Begin
Try
// TForm2 manuel erstellen
Form := TForm2.Create (Self);
Try
// Preview anzeigen;
Form.Quickrep1.Preview;
Finally
// Form wieder freigeben
Form.Free;
End;
Except
{ Fehler! }
End;
End;
procedure TForm1.Button2Click(Sender: TObject);
begin
Form2.QuickRep1.print;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
ADOQuery1.close;
ADOQuery1.SQL.clear;
ADOQuery1.SQL.Add('
select sum(Stunden) AS Gesamtsumme from ADOTable1');
ADOQuery1.Open;
DBEdit3.Text := ADOQuery1.SQL.Values['
Gesamtsumme'];
end;
end.