1, 先申明一个reportdocument对象,然后用reportdocument对象load方法载入rpt文件
2, 给定rpt文件中用到的表的登录信息
3, Crystal Report Viewer 指定报表源为上述对象
4, 绑定ReportDocument myReportDocument = new ReportDocument();
myReportDocument.Load("report1.rpt"); CrystalDecisions.Shared.TableLogOnInfo loginfo=new CrystalDecisions.Shared.TableLogOnInfo();
loginfo.ConnectionInfo.UserID="sa";
loginfo.ConnectionInfo.Password="jjz699";
myReportDocument .Database.Tables["orders"].ApplyLogOnInfo(loginfo);CrystalReportViewer1.ReportSource = myReportDocument ;CrystalReportViewer1.DataBind();
2, 给定rpt文件中用到的表的登录信息
3, Crystal Report Viewer 指定报表源为上述对象
4, 绑定ReportDocument myReportDocument = new ReportDocument();
myReportDocument.Load("report1.rpt"); CrystalDecisions.Shared.TableLogOnInfo loginfo=new CrystalDecisions.Shared.TableLogOnInfo();
loginfo.ConnectionInfo.UserID="sa";
loginfo.ConnectionInfo.Password="jjz699";
myReportDocument .Database.Tables["orders"].ApplyLogOnInfo(loginfo);CrystalReportViewer1.ReportSource = myReportDocument ;CrystalReportViewer1.DataBind();
解决方案 »
- 求个正则表达式
- 崩溃的发布样式问题
- asp.net与css+div
- 请教大虾apache+asp.net2环境 gridview无法动态绑定问题(200分)
- 如何进行页面布局设计
- Asp.net常识问题,求助^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- 下载 PETSHOP 安装后,用VS打开时候 提示 无法创建打开应用程序,然后是 web(不可用)
- 请问一个DataFormatString的小问题
- 如何提供文件下载,并删除的功能
- 为什么我的Server.HtmlEncode(string)没有用?
- 一个很菜的问题。在aspx中使用类,不使用codebehind可以么?
- 请教!ascx控件传递参数是问题!
我按你的方法 还是出现“未将对象的引用设知道对象的实例” 错误?