整个出错页面如下:
“/demoweb”应用程序中的服务器错误。
--------------------------------------------------------------------------------登录失败。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: CrystalDecisions.CrystalReports.Engine.LogOnException: 登录失败。源错误: 执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  堆栈跟踪: 
[LogOnException: 登录失败。]
   .F(String  , EngineExceptionErrorID 
)
   .A(Int16 , Int32 )
   .@(Int16 )
   CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext)
   CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext)
   CrystalDecisions.Web.ReportAgent.u(Boolean N)
   CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e)
   System.Web.UI.Control.PreRenderRecursiveInternal()
   System.Web.UI.Control.PreRenderRecursiveInternal()
   System.Web.UI.Control.PreRenderRecursiveInternal()
   System.Web.UI.Page.ProcessRequestMain() 
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:1.1.4322.573; ASP.NET 版本:1.1.4322.573

解决方案 »

  1.   

    能把你显示report的代码贴出来吗?
      

  2.   

    是这样的:
       1、先用专家报表向导,通过oledb建立一报表crpt1.rpt;
       2、在webform1中添加crystalreportviewer1.
       3、在InitComponent()后加:
         CrystalReportViewer1.ReportSource="c:\\inetpub\\wwwroot\\demorpt\\crpt1.rpt";
         CrystalReportViewer1.DataBind();
       4.运行就出错。
       不知道是不是自带的报表工具的问题???请指点!!
      

  3.   

    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    using CrystalDecisions.Web.Design;string reportName = "crpt1.rpt";
    ReportDocument report;
    TableLogOnInfo logon = new TableLogOnInfo();
    report = new ReportDocument();report.Load(Server.MapPath(reportName));logon.ConnectionInfo.ServerName = "localhost";
    logon.ConnectionInfo.DatabaseName = "yourdatabase";
    logon.ConnectionInfo.UserID = "sa";
    logon.ConnectionInfo.Password = "";
    report.Database.Tables[0].ApplyLogOnInfo(logon);report.Refresh();

    CRViewer.ReportSource = report;
    CRViewer.DataBind();
    CRViewer.Visible = true;
    //report.Close();我是建立了一个ReportDocument对象。注意:crpt1.rpt中的servername一定要与 logon.ConnectionInfo.ServerName 一样。
      

  4.   

    如果数据库是mssqlserver的话,jinzhouk()的方法是正确的,我试过,可如果连接oracle数据库就会出同样的错误,你可以试试看。
    谁作过连接oracle的例子请指教如何避免登录错误!
    谢谢
      

  5.   

    logon.ConnectionInfo.ServerName =DSN;    //Your DSN Name to Oracle;
    logon.ConnectionInfo.DatabaseName = "";  //left it empty
    logon.ConnectionInfo.UserID = "sa";
    logon.ConnectionInfo.Password = "";
    report.Database.Tables[0].ApplyLogOnInfo(logon);