这个问题解决了,可是我又遇上一个问题:把CrystalReportViewer绑定到默认的rpt,显示现在没问题了,但是自已建一个rpt,在编辑器上可以看到各字段的值,但把它绑定到CrystalReportViewer在浏览器上看却提示:为什么呢?还请各位老大帮一下忙。
LogOnException: 登录失败。]
.K(String
, EngineExceptionErrorID ) +546
.F(Int16 , Int32 ) +491
CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext) +459
CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext) +189
CrystalDecisions.Web.ReportAgent.v(Boolean `) +150
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() +1470
LogOnException: 登录失败。]
.K(String
, EngineExceptionErrorID ) +546
.F(Int16 , Int32 ) +491
CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage(PageRequestContext reqContext) +459
CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage(PageRequestContext pageReqContext) +189
CrystalDecisions.Web.ReportAgent.v(Boolean `) +150
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() +1470
解决方案 »
- 关于使用框架去缓存的问题
- asp.net2.0 系统访问缓慢????? 在线
- datagrid如何在后台的Page_load实现前台的一些小效果
- 简单问题(大家给看看)
- 一个关于asp.net中repeater控件使用的问题
- RowUpdating事件该怎么写??十万分的急~~~~~~~~~
- 怎样才能知道目前的URL是否是某个虚拟目录下的内容?
- 请教问题
- 为什么我在页面中用msgbox()方法出现错误呀?
- 高分请教:我在页面A中打开一个弹出窗口B,现需要将B中控件BTEXTBOX的值传到A的控件ATEXTBOX中,如何能做到?
- 如何使用定制頁屬性在Web Froms頁之間傳遞值?
- 执行完下面的语句后,再清空lable的text??(在线!!)
在报表新建生成时输入的用户名和密码,是建立当前查询连接数据库的密码,但用户名和密码并不会保存在你的rpt文件中(可以选择将当前查询的数据与报表一起保存),以便报表在查询引擎中的预览和排版。在web上运行时,需要重新登陆连接数据库的验证信息Report2 tmprpt=new Report2() ; //申明一个报表的实例 ,Report2.rpt 利用crystal report 生成
TableLogOnInfo logOnInfo = new TableLogOnInfo ();
int i = 0;
// 对报表中的每个表依次循环。
for (i=0;i == tmprpt.Database.Tables.Count - 1;i++)
{
// 设置当前表的连接信息。
logOnInfo.ConnectionInfo.ServerName = "127.0.0.0";
logOnInfo.ConnectionInfo.DatabaseName = "temp";
logOnInfo.ConnectionInfo.UserID = "anna";
logOnInfo.ConnectionInfo.Password = "anna";
tmprpt.Database.Tables [i].ApplyLogOnInfo (logOnInfo);
}
CrystalReportViewer1.ReportSource=tmprpt; // CrystalReportViewer 设定 source就可以咯