我有一个应用程序,通过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身份验证不包含此变量。
任何帮助,非常感谢。