2017-02-17 13 views
1

我必須在aspx頁面顯示報告。所以我發現如何在asp頁面中顯示來自報表服務器的報表。他們大多數都使用reportViewer控件,但是,我發現iframe可以很好地查看報告。從iframe中查看使用reportViewer控件的報告的缺點是什麼?

有誰知道他們爲什麼不使用iframe來查看報告?

的iframe:

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

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}"; 
+0

用戶可以查看報告路徑,難以添加CSS。 – Snowlockk

+0

@Slocklockk,但他們無法編輯,更新任何東西到我的數據庫,對不對?如果是這樣,他們在查看報告路徑時遇到了什麼問題(他們無法看到他們沒有權利),更難或添加css? – MRWonderFuXker

+0

取決於您的系統設置。如果報告路徑字符串中存在變量,則可以編輯它們以查看其他人的數據。 – Snowlockk

回答

0

如果iFrame的方法也適用於你 - 那麼它很可能是最簡單的爲您服務。如果您需要更好地控制何時加載報告,想要在沒有服務器的情況下加載本地報告,或者需要使用不同憑據連接到報告服務器,則報告查看器控件非常有用。

相關問題