从Windows应用程序访问ReportServer中的ReportService

从Windows应用程序访问ReportServer中的ReportService,windows,reporting-services,Windows,Reporting Services,这里有一个windows应用程序和一个SSRS报表,其中报表在报表服务器中实现,在此我尝试从windows应用程序调用该报表。在我的按钮中,单击“我添加此代码”: string reportName = "Crime_Traking_Report"; reportViewer1.ServerReport.ReportServerCredentials =new ReportServerCredentials("isroScientist", "password123456

这里有一个windows应用程序和一个SSRS报表,其中报表在报表服务器中实现,在此我尝试从windows应用程序调用该报表。在我的按钮中,单击“我添加此代码”:

string reportName = "Crime_Traking_Report";
            reportViewer1.ServerReport.ReportServerCredentials =new ReportServerCredentials("isroScientist", "password12345678", "Nasa");
            reportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote;
            try
            {
                reportViewer1.ServerReport.ReportServerUrl = new Uri("http://13.88.91.156/ReportServer");
            }
            catch (UriFormatException)
            {
                Console.WriteLine("Bad Url format");
            }
            reportViewer1.ServerReport.ReportPath = "/iSROReportsStandard/" + reportName;
            reportViewer1.ProcessingMode = ProcessingMode.Remote;
            reportViewer1.ServerReport.Refresh();

在这里,我当然希望将凭据传递给access,但当我运行应用程序时,它会给出一个错误,如“ReportServerCredentials没有定义构造函数”,为了成功地通过我的代码传递凭据,我想做什么更改。请通过代码向我解释。

问题是,我的解决方案与您的其他问题相同。看我的答案。应使用
ServerReport.setDataSourceRedentials
方法