2012-06-09 22 views
0

我已經在運行Win 7和SQL Server 2008 R2的計算機上部署了ssrs報告。我試圖從部署在同一臺機器上的ASP.NET應用程序訪問這些報告。我可以從配置工具的URL訪問報告。但是當我從部署的ASP.NET應用程序訪問它時,它會引發「未經授權」錯誤。該應用程序是在Win XP,SQL Server 2008環境下開發的。我有很多可能從互聯網上注意到。但不知道從ASP.NET應用程序中知道我缺少什麼來訪問報表。無法訪問ssrs來自ASP.NET的報告

請幫忙。 感謝

+0

你能解釋一下多一點的實現? –

+0

請讓我知道我需要一些不同的解決方案或您的案例不同。 – Pratik

回答

1

放在Page_Load事件的代碼和包括使用Microsoft.Reporting.WebForms ;:時,報告指出錯誤的服務器上,需要 遠程模式:

if (!Page.IsPostBack) 
     { 
      ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote; 
      ReportViewer1.ServerReport.ReportServerUrl = new Uri(rptServerUrl); 
      ReportViewer1.ServerReport.ReportPath ="Exact Report Path Here"; 
      ReportViewer1.ServerReport.ReportServerCredentials = new ReportViewerCredentials(userId, password, domain); 
     }`