[em26]作者: 大頭 时间: 2003-12-29 08:22
使用Snapshot View Control 物件即可實現,完整功能畫面
CREATE 一個acxSna Snapshot View Control 物件
Private Sub cmdRep3_Click()
sPrint "ReportName" ‘報表名稱
End Sub
公用模組
Option Compare Database
Option Explicit
Private strRepFil As String, strSavePath As String
Private ctlActiveXHolder As Control
Sub sPrint_Init()
'Initialize
strSavePath = "C:\"
Set ctlActiveXHolder = Forms![frmReportViewer].acxSna
End Sub
Sub sPrint(strReport As String, Optional booNoPreview As Boolean = True, Optional strFilter As String = "")
sPrint_Init
strRepFil = strFilter
DoCmd.OutputTo acOutputReport, strReport, "Snapshot Format", strSavePath & strReport & ".snp"
With ctlActiveXHolder
.SnapshotPath = "C:\" & strReport & ".snp"
End With
End Sub