......
For TmpI:=Num to sGrid.RowCount-1do
begin
Inc(Num1);
Y1:=150*Num1+300;//TmpI
Y2:=150*(Num1+1)+300;//TmpI
TR:=Rect(X1, Y1, X2-10, Y2);
Printer.Canvas.Rectangle(X1, Y1, X2-10, Y2);
Printer.Canvas.TextRect(TR, X1+20, Y1+20, sGrid.Cells[F, TmpI]);
If F = sGrid.ColCount-1 then
begin
Printer.Canvas.MoveTo(X2-10, Y1);
Printer.Canvas.LineTo(X2-10, Y2);
end;
if TmpI mod 27=0 then
****把27改为大于27的数就不行,小于等于27的数则正常********
begin
bNewPage:=True;
Printer.Canvas.MoveTo(X1, Y2);
Printer.Canvas.LineTo(X2-10, Y2);
Break;
end;
j:=TmpI;
end;
.................