求助!使用 ReportViewer 控件集成 Reporting Services2008 时,报"...401 unauthorized"错误!新程序需要 Reporting Services2008 做报表服务,用c#开发, 
系统希望用web中显示 Reporting Services2008报表。为了传递参数,我采用 ReportViewer 控件集成 Reporting Services2008 ,来展示报表。通过url访问报表,可以正常显示。
但是通过ReportViewer 控件集成就爆出401 unauthorized错误!!!!请路过的各位高手支招~~~~代码如下:
 ReportViewer1.ProcessingMode = ProcessingMode.Remote;        ServerReport serverReport = ReportViewer1.ServerReport;
        
        serverReport.ReportServerUrl =
            new Uri("http://IP/ReportServer");
        serverReport.ReportPath =
            "/ReportServers_Demo/test report1";        Microsoft.Reporting.WebForms.ReportParameter[] paras = new Microsoft.Reporting.WebForms.ReportParameter[3];        paras[0] = new Microsoft.Reporting.WebForms.ReportParameter("addr", "北京");
        paras[1] = new Microsoft.Reporting.WebForms.ReportParameter("type", "1");
        paras[2] = new Microsoft.Reporting.WebForms.ReportParameter("Time", "2010-09-00");
        ReportViewer1.ServerReport.SetParameters(paras);
我没多少分了,哪个给解决了我的分就都给你了。

解决方案 »

  1.   

    Credentials用的不对
    ReportingService rs = new ReportingService();
    rs.Credentials = System.Net.CredentialCache.DefaultCredentials.
    http://www.codeproject.com/Articles/39007/A-Wrapper-for-Running-SQL-Server-2008-Reporting-Se.aspx
      

  2.   

    [Quote=引用 2 楼 wuyq11 的回复:]
    Credentials用的不对
    ReportingService rs = new ReportingService();
    rs.Credentials = System.Net.CredentialCache.DefaultCredentials.
    http://www.codeproject.com/Articles/39007/A-Wrapper-for-Running-SQL-Ser……
    非常感谢技术援助:Credentials用的不对
    ReportingService rs = new ReportingService(); 
    这个能说的明白点吗?我看了你提供的文章,说实话,我英语不太好,看不懂~~~