【发布时间】:2018-06-25 17:52:19
【问题描述】:
我曾尝试使用报表查看器实现 SSRS 报表集成,但不知何故我无法做到。 http://abcd1234/Reports/Pages/Report.aspx?ItemPath=%2fMyReportFolder%2fCityList
其中 abcd1234 是报表服务器,CityList 是报表名称。上面的 URL 是在服务器上打开报表的报表 URL。
我不确定此 URL 是否存在问题,我们必须更改 SSRS 服务器上的某些设置以获取报告的其他 URL。 我尝试使用 :: https://www.c-sharpcorner.com/article/how-to-display-ssrs-report-in-asp-net-mvc-web-application/ 但做不到。 如果我可以使用具有上述 URL 的报表查看器获得相同的代码来呈现报表,那将非常有帮助。
我尝试过的:
String reportFolder = System.Configuration.ConfigurationManager.AppSettings["SSRSReportsFolder"].ToString();
rvSiteMapping.Height = Unit.Pixel(Convert.ToInt32(Request["Height"])
- 58);
rvSiteMapping.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
rvSiteMapping.ServerReport.ReportServerUrl = new Uri("http://abcd1234/Reports/Pages/Folder.aspx?ItemPath=%2fMyReportFolder"); // Add the Reporting Server URL
rvSiteMapping.ServerReport.ReportPath = String.Format("/{0}/{1}", reportFolder, Request["ReportName"].ToString());
rvSiteMapping.ServerReport.Refresh();
【问题讨论】:
-
为什么不直接使用URL呢?
-
你得到什么错误?
-
@TonyDong 直接使用 URL 是什么意思?我还需要从我的 .net 应用程序中传递一些参数。
-
@MohsinMehmood .. 我使用了 rvSiteMapping.ServerReport.ReportServerUrl = new Uri("abcd1234/") 并收到以下错误:“连接到报表服务器的尝试失败。检查您的连接信息以及报表服务器是否为兼容版本。请求失败,HTTP 状态 404:未找到。”我不确定我是否使用了正确的值服务器。
-
可以在URL中传递参数。
标签: asp.net reporting-services reportviewer