日期:2014-05-19  浏览次数:20460 次

水晶报表的错误:有办法解决么?
“/zjfc_plantWorkingFolder”应用程序中的服务器错误。
--------------------------------------------

登录失败。  
说明:   执行当前   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

------解决方案--------------------
TableLogOnInfo logonInfo = new TableLogOnInfo();//
foreach( CrystalDecisions.CrystalReports.Engine.Table tb in ReportDoc.Database.Tables)
{
logonInfo = tb.LogOnInfo;
logonInfo.ConnectionInfo.ServerName = "(local) ";
logonInfo.ConnectionInfo.DatabaseName = "myDatabase ";//
logonInfo.ConnectionInfo.UserID = "sa ";
logonInfo.ConnectionInfo.Password = "111 ";//
tb.ApplyLogOnInfo(logonInfo);

}
在pageload里加上这段代码。。。