我有一個應用程序,通過SOAP Web服務呈現SSRS報告。我試圖做的是將憑據傳遞給將由數據源用於數據庫訪問的ReportExecutionService。SSRS DataSourceCredentials和Windows身份驗證
這是目前正在使用SQL身份驗證。我試圖弄清楚的是如何使用Windows身份驗證爲使用數據庫配置的用戶獲得此功能。用戶帳戶是一個域用戶帳戶,我將此用戶添加到數據庫和db_owner角色。
當我通過憑據的Windows用戶帳戶和運行SQL事件探查我收到以下錯誤信息:
Login failed for user 'ourdomain\User'. Reason: Attempting to use an NT account name with SQL Server Authentication. [CLIENT: <local machine>]
下面的代碼是通過證書的時正在工作(略)代碼SQL用戶,但上述消息未能傳遞域用戶憑據時:
public static byte[] RunReport(string reportPath, List<ReportParameter> reportParameters, ReportOutputType outputType)
{
ReportExecutionService reportExecutionService = new ReportExecutionService();
var creds = new DataSourceCredentials[1];
creds[0] = new DataSourceCredentials() { DataSourceName = "DynamicDataSource", UserName = ReportUserDomain + @"\" + ReportUserAccount, Password = ReportUserPassword };
reportExecutionService.LoadReport(reportPath, null);
reportExecutionService.SetExecutionCredentials(creds);
return reportExecutionService.Render(Enum.GetName(typeof(ReportOutputType), outputType), GetDeviceInfo(outputType), out extension, out mimetype, out encoding, out warning, out streamids);
}
請注意,我說的ReportUserDomain參數的DataSourceCredentials,試圖讓這對Windows驗證工作,當前正在幹活的代碼g for SQL身份驗證不包含此變量。
任何幫助,非常感謝。