如只是指定每页打印N条记录的话: 在BAND的BEFORE PRINT中判断: IF [LINE#]-1>0 AND ([LINE#]-1) MOD 你的条数=0 THEN NEWPAGE
或者你在MEMO中放入[FREESPACE]确定剩余空间
下面是我求页面高度的代码,不设页边距时,是正常的;设页边距后,就有偏差了; TotalHeight:=0; TotalHeight:=TotalHeight+TfrBandView(frReport1.FindObject('报表头1')).dy; TotalHeight:=ToTalHeight+TfrBandView(frReport1.FindObject('页头1')).dy; if AutoFit=0 then Number:=DataSource1.DataSet.RecordCount else Number:=AutoFit; for i:=1 to Number do TotalHeight:=TotalHeight+TfrBandView(frReport1.FindObject('主项数据1')).dy; TotalHeight:=TotalHeight+TfrBandView(frReport1.FindObject('页尾1')).dy; TotalHeight:=TotalHeight+TfrBandView(frReport1.FindObject('报表尾1')).dy; PageHeight:=trunc((TotalHeight+(0.6*Page.pgMargins.Top+1.1*Page.pgMargins.Bottom))*50 /18)+1; // PageHeight:=Round((TotalHeight+(frReport1.Pages[0].TopMargin+(1069- // frReport1.Pages[0].BottomMargin)*BottomDif)/PointY*4)/Screen.PixelsPerInch*254+3); frReport1.Terminated:=True;
在BAND的BEFORE PRINT中判断:
IF [LINE#]-1>0 AND ([LINE#]-1) MOD 你的条数=0 THEN NEWPAGE
TotalHeight:=0;
TotalHeight:=TotalHeight+TfrBandView(frReport1.FindObject('报表头1')).dy;
TotalHeight:=ToTalHeight+TfrBandView(frReport1.FindObject('页头1')).dy;
if AutoFit=0 then
Number:=DataSource1.DataSet.RecordCount
else
Number:=AutoFit;
for i:=1 to Number do
TotalHeight:=TotalHeight+TfrBandView(frReport1.FindObject('主项数据1')).dy;
TotalHeight:=TotalHeight+TfrBandView(frReport1.FindObject('页尾1')).dy;
TotalHeight:=TotalHeight+TfrBandView(frReport1.FindObject('报表尾1')).dy;
PageHeight:=trunc((TotalHeight+(0.6*Page.pgMargins.Top+1.1*Page.pgMargins.Bottom))*50 /18)+1;
// PageHeight:=Round((TotalHeight+(frReport1.Pages[0].TopMargin+(1069-
// frReport1.Pages[0].BottomMargin)*BottomDif)/PointY*4)/Screen.PixelsPerInch*254+3);
frReport1.Terminated:=True;