从Asp.net运行报告、子报告和参数

从Asp.net运行报告、子报告和参数,asp.net,reporting-services,Asp.net,Reporting Services,我必须开发一个asp.net网页,它将执行在SSRS中开发的一些报告。该报告包含一些其他子报告,这些子报告将被执行并将结果保存到excel和pdf中。 我的问题是如何在Asp.net中运行此报表和子报表? 我知道如何执行单个报表,但它不是单个报表它的报表\内部报表 任何人都可以告诉我您需要为报表的SubReportProcessing事件附加一个处理程序。在vb.net中: AddHandler _report.SubreportProcessing, AddressOf RunSubRepor

我必须开发一个asp.net网页,它将执行在SSRS中开发的一些报告。该报告包含一些其他子报告,这些子报告将被执行并将结果保存到excel和pdf中。 我的问题是如何在Asp.net中运行此报表和子报表? 我知道如何执行单个报表,但它不是单个报表它的报表\内部报表
任何人都可以告诉我您需要为报表的SubReportProcessing事件附加一个处理程序。在vb.net中:

AddHandler _report.SubreportProcessing, AddressOf RunSubReport
Sub RunSubReport(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs)
         'Set ds to your dataset        
         e.DataSources.Add(New ReportDataSource("YourDataSourceName", ds))   
End Sub
有关向子报表添加参数的讨论,请参阅此堆栈溢出问题:

直接将它们添加到主报告中:

'Passing in parameters to the report to display in the header
Dim paramCollection As New Collections.Generic.List(Of Microsoft.Reporting.WinForms.ReportParameter)
paramCollection.Add(New Microsoft.Reporting.WinForms.ReportParameter("startDate", startDate.ToShortDateString))
paramCollection.Add(New Microsoft.Reporting.WinForms.ReportParameter("endDate", endDate.ToShortDateString))

'Set report parameters
_report.SetParameters(paramCollection)

谢谢Anna我需要处理程序关于参数的什么,因为所有报告都应该由特定的参数执行。