1.要进行页小计,需要在报表设计时建立3个公式,一个(SumRows)放在明细节内用于WhilePrintingRecords事件进行全局变量RowTotal累加,一个(PageTotal)放在页脚n(报脚n、组脚n、细节n)内用于反映RowTotal即时值,一个(Reset)放在PageTotal后用于下页前回零RowTotal;SumRows公式:
WhilePrintingRecords  
global RowTotal as currency 
RowTotal= RowTotal +  CCur({Order.Money})  
formula=RowTotalPageTotal公式:
WhilePrintingRecords
global RowTotal as currency
formula=RowTotal Reset公式:
EvaluateAfter ({@subtotal})
global RowTotal as currency
RowTotal=0
formula=02.固定行分页
要进行固定行分页需要在报表设计时添加参数PrintRows(设为数值型,默认值设10)用于打印前告诉报表打多少行,动态赋值代码:
Dim oFld As CRAXDRT.ParameterFieldDefinition
dim nRows as integer
nRows=8
For Each oFld In oReport.ParameterFields            If oFld.ParameterFieldName = "printrows" Then                oFld.AddCurrentValue nRows
                Exit For
            End If        Next
然后编辑明细节“在后面页新建页”公式内容加入:
if Remainder(RecordNumber, {?printrows}) = 0 then
  if OnLastRecord then 
   formula=false
  else
   formula=true
  end if
end if3.最恼人的问题,分页中每页显示紧贴式页脚?只有组节和明细节可实现紧贴页脚!这里使用明细节替代页脚:
需要2个明细节,第一个用于正常显示明细记录,第二个用于代替页脚放置业脚内容,编辑第二明细节"抑制显示"公式,内容加入:
if Remainder(RecordNumber, {?printrows} ) <> 0 then
 if OnLastRecord  then 
  formula=false
 else
 formula=true
 end if
end if