给你一个大概的例子。
var
lix,liy,kk :Integer;
begin
if printer.Printing then Exit;
kk:=0;
lix:=FiXbegin;
liy:=FiYbegin;
printer.BeginDoc;
with printer do
begin
Fdataset.First;
while not Fdataset.Eof do
begin
end;
Canvas.Font.Size:=12;
Canvas.TextOut(450,210,FsTotal);
Canvas.TextOut(650,210,FsPay);
Canvas.TextOut(850,210,FsPayBack);
Canvas.Font.Size:=10;
Canvas.TextOut(100,280,FsShopID);
Canvas.TextOut(350,280,FsTelephone);
Canvas.TextOut(700,280,FsDate);
end;
printer.EndDoc;
end;