以下是引用guoya在2003-8-19 7:28:00的发言:
可以通过设置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
以下是引用一点通在2007-6-12 13:28:00的发言:
在生成MDE文件前,将数据库的选项设置一下就可以
工具--选项--常规--跟踪名称自动更正信息,不打勾就OK
以下是引用andymark在2007-6-14 17:39:00的发言:
MDB可以把自定义纸张保存在表中调用,不会因环境的改变而变.转成MDE,有些属性不一定支持,具体没测试过
另一种方法用VSPRINT控件,但比较麻烦。要求不大的用一点通管理员的方法比较好
以下是引用一点通在2007-6-12 13:28:00的发言:
在生成MDE文件前,将数据库的选项设置一下就可以
工具--选项--常规--跟踪名称自动更正信息,不打勾就OK
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) | Powered by Discuz! X3.3 |