procedure TForm2.PrintMyReport;
var
NPixX,NPixY:Integer;
i,m,j:Integer;
nx,ny:Integer;
hei:Single;
rhei,rHeight,rWid:Single;
begin
//nx:=-5;
ny:=0;
hei:=0.295;
rhei:=0.3;
rWid:=1.5;
rHeight:=2.8;
printer.PrinterIndex:=-1;
printer.Orientation:=poPortrait;
//纵向打印
NPixX:=GetDeviceCaps(printer.Handle,LOGPIXELSX);
NPixY:=GetDeviceCaps(printer.Handle,LOGPIXELSY);
printer.begin
Doc;
printer.Canvas.Font.Name:='宋体/0';
printer.Canvas.Font.Height:=28;
printer.Canvas.TextOut(trunc(NPixX*0.42),trunc(NPixY*0.7)+ny,Label1.Caption);
printer.Canvas.TextOut(trunc(NPixX*0.42)+150,trunc(NPixY*0.7)+ny,MLabel5.Caption);
ny := ny+40;
printer.Canvas.TextOut(trunc(NPixX*0.42),trunc(NPixY*0.7)+ny,Label5.Caption);
printer.Canvas.TextOut(trunc(NPixX*0.42)+150,trunc(NPixY*0.7)+ny,MLabel9.Caption);
ny := ny+40;
printer.Canvas.TextOut(trunc(NPixX*0.42),trunc(NPixY*0.7)+ny,Label2.Caption);
printer.Canvas.TextOut(trunc(NPixX*0.42)+150,trunc(NPixY*0.7)+ny,MLabel6.Caption);
ny := ny+40;
printer.Canvas.TextOut(trunc(NPixX*0.42),trunc(NPixY*0.7)+ny,Label3.Caption);
printer.Canvas.TextOut(trunc(NPixX*0.42)+150,trunc(NPixY*0.7)+ny,MLabel7.Caption);
ny := ny+40;
printer.Canvas.TextOut(trunc(NPixX*0.42),trunc(NPixY*0.7)+ny,Label4.Caption);
printer.Canvas.TextOut(trunc(NPixX*0.42)+150,trunc(NPixY*0.7)+ny,MLabel8.Caption);
printer.EndDoc;
end;