[英]SQL Server Reporting Services - Send Reports from different email addresses
[英]Asp.Net, VB, SQL Server Reporting Services..dynamically generated reports from directory to be viewed on report viewer on click?
我有一个aspx webform,它的vb代码从目录中读取.rdl文件,然后将它们列出为按钮或超级链接等。“报告在本地主机报告服务器上”
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim FileLocation As DirectoryInfo = _
New DirectoryInfo("C:\inetpub\wwwroot\Reports")
Dim fi As FileInfo() = FileLocation.GetFiles("*.rdl")
For Each name As FileInfo In fi
' Dim i As Integer
Dim listed As New LinkButton
' listed.Attributes("CssClass") = "a"
' listed.Attributes("Class") = "a"
listed.Attributes("id") = "listed"
listed.Text = (name.Name)
mine.Controls.Add(listed)
'mine.InnerHtml = ""
'i = i + 1
Next
End Sub
另一个具有reportviewer。 单击报告后,如何将名称/值发送给查看器并重定向到它?
非常感谢你
编辑:我必须使点击重定向到带有字符串的查看器,并让查看器使用该字符串,但是无论如何我都尝试过它,仍然有错误
项目“ salesreport.rdl”的路径无效。 完整路径的长度必须少于260个字符; 其他限制条件也适用。 如果报表服务器处于纯模式,则路径必须以斜杠开头。 (rsInvalidItemPath)
这是查看器代码
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
' Retrieve parameter from Route "Reports/{reportName}"
Dim reportName = Picks.Selecty
'Page.Title = reportName
ReportViewer1.ProcessingMode = ProcessingMode.Remote
Dim serverReport As ServerReport
ServerReport = ReportViewer1.ServerReport
serverReport.ReportServerUrl = New Uri("http://localhost/reportserver/")
serverReport.ReportPath = reportName
' reportName
'
' add parameters here
'Dim param As New ReportParameter("name", "value")
'serverReport.SetParameters(param)
serverReport.Refresh()
End If
End Sub
您可以尝试以下方法。
希望能有所帮助
谢谢Prawin
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.