使用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
可以參考這些指令
繼續優化
[此贴子已经被作者于2003-12-29 23:00:56编辑过]
|