从iframe查看报表而不是使用reportViewer控件的缺点是什么?

从iframe查看报表而不是使用reportViewer控件的缺点是什么?,iframe,reporting-services,Iframe,Reporting Services,我必须在aspx页面中显示报告。所以我找到了如何在asp页面中显示来自报表服务器的报表。大多数都使用reportViewer控件,但我发现iframe可以很好地查看报告 有人知道为什么不使用iframe查看报告吗 iframe: <iframe src="http://{server}/ReportServer/Pages/ReportViewer.aspx?{mypath}" id="frame" runat="server" width="1500" height="800">i

我必须在aspx页面中显示报告。所以我找到了如何在asp页面中显示来自报表服务器的报表。大多数都使用reportViewer控件,但我发现iframe可以很好地查看报告

有人知道为什么不使用iframe查看报告吗

iframe:

<iframe src="http://{server}/ReportServer/Pages/ReportViewer.aspx?{mypath}" id="frame" runat="server" width="1500" height="800">input URL is invalid </iframe>
输入URL无效
reportViewer控件:

     <rsweb:ReportViewer runat="server" ID="MyReportViewer" Width="100%" Height="700px"></rsweb:ReportViewer>

//C#

     MyReportViewer.ProcessingMode = ProcessingMode.Remote;
                    ServerReport serverReport = MyReportViewer.ServerReport;
                    // Set the report server URL and report path
                    serverReport.ReportServerUrl = new Uri("http://{server}/ReportServer");
                    serverReport.ReportPath = "/{myPath}";

//C#
MyReportViewer.ProcessingMode=ProcessingMode.Remote;
ServerReport ServerReport=MyReportViewer.ServerReport;
//设置报表服务器URL和报表路径
serverReport.ReportServerUrl=新Uri(“http://{server}/ReportServer”);
serverReport.ReportPath=“/{myPath}”;

如果iFrame方法适合您,那么它可能是最简单的方法。如果您需要更好地控制何时加载报表,希望在没有服务器的情况下加载本地报表,或者需要使用不同的凭据连接到报表服务器,则报表查看器控件非常有用。

用户可以查看报表路径,添加css比较困难。@Snowlock,但他们无法编辑、更新“我的数据库”中的任何内容,对吗?如果是这样的话,他们查看报告路径(他们看不到自己是否没有权限)、添加css有什么问题?这取决于系统的设置方式。如果您的报告路径字符串中有变量,他们可以编辑这些变量以查看其他人的数据。您仍然可以导出到Excel吗?是否可以在iframe中添加钻取报告?