加载报表失败??

zzxap 2008-11-29 11:34:41
Private Sub band()
Dim logOnInfo As New TableLogOnInfo()
Dim rpdMy0 As New ReportDocument()
logOnInfo.ConnectionInfo.ServerName = "hjsql01\develop"

logOnInfo.ConnectionInfo.Password = "sa"

logOnInfo.ConnectionInfo.DatabaseName = "Training"

logOnInfo.ConnectionInfo.UserID = "sa"
Dim path As String = Server.MapPath("employee.rpt")
rpdMy0.Load(path)
rpdMy0.Database.Tables(0).ApplyLogOnInfo(logOnInfo)
CrystalReportViewer1.ReportSource = rpdMy0

End Sub

这样就可以加载成功,employee.rpt拉模式的。

Private Sub band()
Dim oRpt As New ReportDocument()
Dim ds As DataSet = Nothing
Dim clsDBProcess As New dbprocess.OledbProcess
Dim strsql As String = ""
strsql = "selece * from employee "
ds = clsDBProcess.GetDataSet(Session("Server"), Session("Database"), strsql)
Dim path As String = Server.MapPath("report/employee.rpt")
oRpt.Load(path)
oRpt.SetDataSource(ds)
CrystalReportViewer1.ReportSource = oRpt

End Sub


这样就加载不了报表,report/employee.rpt是一个空白报表。

已经把C:\Program Files\Common Files\Business Objects\2.7\Managed 下所有的文件都COPY到远程服务器网站的BIN目录下,
c.改注册表HKEY_LOCAL_MACHINE\SOFTWARE\Crystal Decisions\10.2\Report Application Server\InProcServer\PrintJobLimit将PrintJobLimit由75改为0
...全文
306 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
liyan126 2011-05-28
  • 打赏
  • 举报
回复
Load report failed
xqy_2007 2008-12-01
  • 打赏
  • 举报
回复
一般源程序移了位置后出现加载失败的提示,你重新引用一下数据源.
zzxap 2008-12-01
  • 打赏
  • 举报
回复
需要手工建立dtaset吗?我没有手工建立dataset
zzxap 2008-12-01
  • 打赏
  • 举报
回复
Load report failed.
阿泰 2008-12-01
  • 打赏
  • 举报
回复
加载失败和返回一个空报表是完全两个不同的概念,前者是系统报错,后者是不报错,只是报表上没有数据。
如果是加载失败,把报错信息贴出来看看。
zzxap 2008-12-01
  • 打赏
  • 举报
回复
private ReportDocument ReportDoc = new ReportDocument();
private void BindServer()
{
dbprocess.OledbProcess clsDBProcess = new dbprocess.OledbProcess();
DataSet ds = default(DataSet);
string strsql = null;
strsql = "select * from employee";
ds = clsDBProcess.GetDataSet(Session("Server"), Session("Database"), strsql);
ds.EnforceConstraints = false;
ReportDoc.Load(Server.MapPath("report\\Employee.rpt")); //Employee.rpt是一个空报表
ReportDoc.SetDataSource(ds.Tables(0));
this.CrystalReportViewer1.ReportSource = ReportDoc;
}

这样还是加载失败
zhuxianzhu 2008-12-01
  • 打赏
  • 举报
回复
ReportDoc.Load(Server.MapPath("~/report/employ.rpt"))
用这个路径试试
阿泰 2008-11-30
  • 打赏
  • 举报
回复
1:希望你这里只是帖子里错了而不是代码本身错了 strsql = "selece * from employee " ,selece =>Select
2: oRpt.SetDataSource(ds) =>oRpt.SetDataSource(ds.Tables(0))


zzxap 2008-11-29
  • 打赏
  • 举报
回复
人气很少啊

4,816

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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