|
可以通过设置printer属性进行,建立一个表[页面],将参数写入其中,然后在报表中调用该函数
Public Sub PrintMargin(r As Report)
Dim intTop As Integer '上边距
Dim intLeft As Integer '左边距
Dim intBottom As Integer '下边距
Dim intRight As Integer '右边距
Dim strPrtname As String '报表名称
Dim intpapersize As Integer '纸张大小
Dim intorientation As Integer '打印方向
strPrtname = r.Name
intTop = DLookup("[RPTTOP]", "页面", "[RPTNAME]='" & strPrtname & "'") * 567
intBottom = DLookup("[RPTBOT]", "页面", "[RPTNAME]='" & strPrtname & "'") * 567
intLeft = DLookup("[RPTLEFT]", "页面", "[RPTNAME]='" & strPrtname & "'") * 567
intRight = DLookup("[RPTRIGHT]", "页面", "[RPTNAME]='" & strPrtname & "'") * 567
intpapersize = DLookup("[papersize]", "页面", "[RPTNAME]='" & strPrtname & "'")
intorientation = DLookup("[Orientation]", "页面", "[RPTNAME]='" & strPrtname & "'")
r.Printer.PaperSize = intpapersize
r.Printer.Orientation = intorientation
r.Printer.TopMargin = intTop
r.Printer.BottomMargin = intBottom
r.Printer.LeftMargin = intLeft
r.Printer.RightMargin = intRight
End Sub
注意:必须位access xp |
|