我无法从我的asp.net网页链接到ssrs报告。 直接链接是
服务器/报告/页/ Report.aspx?ItemPath =%2fRig +控制板%2fRig +状态+报告
我还需要传递两个参数,即FileTypeID和Date
请帮忙......
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://server/Reports"); // Report Server URL
ReportViewer1.ServerReport.ReportPath = "/Rig Dashboard/Rig Status Report"; // Report Name
ReportViewer1.ShowParameterPrompts = false;
ReportViewer1.ShowPrintButton = true;
ReportViewer1.ServerReport.Refresh();
尝试连接到报表服务器失败。检查连接信息,并且报表服务器是兼容版本。 请求失败,HTTP状态为404:Not Found。
答案 0 :(得分:1)
你做错了。您正在尝试调用“登录页面”:/ Reports NOT THE SERVICE:/ ReportServer。 Yuriy给了你一个开始的好地方。我可以举例说明我是如何在WPF中使用的一些本地代码中调用Windows窗体(blech!):
private void ResetReportViewer(ProcessingMode mode)
{
this.reportViewer.Clear();
this.reportViewer.LocalReport.DataSources.Clear();
this.reportViewer.ProcessingMode = mode;
}
private void ReportViewerRemote_Load(object sender, EventArgs e)
{
ResetReportViewer(ProcessingMode.Remote);
reportViewer.ServerReport.ReportServerUrl = new Uri(@"http://server/ReportServer");
reportViewer.ServerReport.ReportPath = "/Folder/ReportName";
reportViewer.RefreshReport();
}
private void ReportViewerRemoteWithCred_Load(object sender, EventArgs e)
{
ResetReportViewer(ProcessingMode.Remote);
reportViewer.ServerReport.ReportServerUrl = new Uri(@"http://server/ReportServer");
reportViewer.ServerReport.ReportPath = "/Folder/ReportName";
DataSourceCredentials dsCrendtials = new DataSourceCredentials();
dsCrendtials.Name = "DataSource1";
dsCrendtials.UserId = "DedicatedUser";
dsCrendtials.Password = "P@ssword(jk)";
reportViewer.ServerReport.SetDataSourceCredentials(new DataSourceCredentials[] { dsCrendtials });
reportViewer.RefreshReport();
}