Click here to Skip to main content
15,881,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting this error while setting SetDatasourceCredentials: An attempt was made to set credentials for a data source 'CRMDataSource' associated with the report. Report data source settings are specified in a way that prevents credentials from being submitted to the report server. ---> Microsoft.ReportingServices.Diagnostics.Utilities.DataSourceNoPromptException: An attempt was made to set credentials for a data source 'CRMDataSource' associated with the report. Report data source settings are specified in a way that prevents credentials from being submitted to the report server.

The below is the code I am using:

C#
  WhoAmIRequest req = new WhoAmIRequest();
                WhoAmIResponse resp = (WhoAmIResponse)sysService.Execute(req);
               
                string userName = resp.UserId.ToString();
                string password = resp.OrganizationId.ToString();   

eporting.WebForms.Internal.Soap.ReportingServices2005.Execution.DataSourceCredentials dsc = new Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.DataSourceCredentials();
                dsc.DataSourceName = "CRMDataSource"; //this is DataSource name in the actual Report.

                dsc.Password = password; //orgId
                dsc.UserName = userName; //userId

                Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.DataSourceCredentials[] Credentials = new Microsoft.Reporting.WebForms.Internal.Soap.ReportingServices2005.Execution.DataSourceCredentials[1];
                Credentials[0] = dsc;
               
               
               rs.SetExecutionCredentials(Credentials);


Please suggest.
Posted
Updated 29-Sep-14 5:12am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900