crystal Report的Logon Fail问题

tristones 2003-08-19 11:46:24
我在web form里面嵌入的crystalReportViewer,页面调用的时候,报错说登录错误。
错误如下Logon failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[LogOnException: Logon failed.]
.F(String , EngineExceptionErrorID
) +506
.A(Int16 , Int32 ) +537
CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext) +539
CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext) +189
CrystalDecisions.Web.ReportAgent.u(Boolean N) +164
CrystalDecisions.Web.CrystalReportViewer.OnPreRender(EventArgs e) +108
System.Web.UI.Control.PreRenderRecursiveInternal() +62
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Page.ProcessRequestMain() +1489
我查了ms说cr在sql2k下有这样的logon fail的bug,但是,根据她的方法修改,还是
没有效果,一样的logon fail.
我的代码如下
public class test4 : System.Web.UI.Page
{
protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;

//Crystal Report Variables
SalesStatistics crReportDocument=new SalesStatistics();

//'CrystalReport1' must be the name the CrystalReport
TableLogOnInfo crTableLogOnInfo = new TableLogOnInfo();
ConnectionInfo crConnectionInfo = new ConnectionInfo();

//Crystal Report Properties
CrystalDecisions.CrystalReports.Engine.Database crDatabase;
CrystalDecisions.CrystalReports.Engine.Tables crTables;
CrystalDecisions.CrystalReports.Engine.Table crTable;

private void Page_Load(object sender, System.EventArgs e)
{
crConnectionInfo.ServerName = "(local)";
crConnectionInfo.DatabaseName = "databasename
crConnectionInfo.UserID = "userid
crConnectionInfo.Password = "password
crDatabase = crReportDocument.Database;
crTables = crDatabase.Tables;

foreach(CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
{

crTableLogOnInfo = crTable.LogOnInfo;
crTableLogOnInfo.ConnectionInfo = crConnectionInfo;
crTable.ApplyLogOnInfo(crTableLogOnInfo);
}

CrystalReportViewer1.ReportSource = crReportDocument;




}

...全文
111 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Oceanson 2003-09-04
  • 打赏
  • 举报
回复
jie jie
jie jie
jie jie jie
tristones 2003-09-01
  • 打赏
  • 举报
回复
没人愿意回答,那就谁来接分。
我结贴了。
tristones 2003-08-19
  • 打赏
  • 举报
回复
我现在在前端的aspx页面里面,直接使用绑定的dataset方式,
然后设置crystalReport对象的setDataSource()方法,指定前面绑定的
数据集可以成功打开CrystalReportViewer,
但是,通过我的上一贴的代码,指定crTable.ApplyLogOnInfo(crTableLogOnInfo);方法,
还是产生Logon Fail错误。

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧