我正在使用asp.net上的Crystal Report查看器的内置导出功能。报告的预览是正确的,但是当我将其导出为任何格式时,它不使用选择公式,而是打印所有数据。我需要将选择公式传递到导出吗?
下面是我的代码:
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
Dim rdoc = New ReportDocument
Dim rptFile As String = ""
rptFile = "C:\report.rpt"
rdoc.Load(rptFile)
Me.CrystalReportViewer1.SelectionFormula = "{report.id} = '" & ID & "'"
Me.CrystalReportViewer1.ReportSource = rdoc
End Sub