我有一些调用报告的代码,但即使我将参数传递到报告中,用户仍需要在报告本身呈现之前单击“查看报告”按钮。有没有办法改变这个?
Function Report(vm As ReportParameterViewModel) As ActionResult
''lazy loading of report details, path
Dim reportDetails = Reports.Value
reportDetails.Load(vm.ReportId)
''private function that returns ReportViewer and sets a few details of it
Dim viewer = SetUpReportViewer()
viewer.ServerReport.ReportServerUrl = reportDetails.ReportServerUrl
viewer.ServerReport.ReportPath = reportDetails.ReportPath
viewer.ServerReport.SetParameters(GetParams(vm))
viewer.ServerReport.Refresh()
ViewBag.ReportViewer = viewer
Return View()
End Function
我是否可以添加一些内容以立即运行报告,而无需用户交互?