查看: 1633|回复: 19
|
Deployment时遇到了crystal report的问题
[复制链接]
|
|

楼主 |
发表于 20-1-2005 02:26 PM
|
显示全部楼层
补充:1)我用的是Microsoft Visual Studio .NET 2003,MSDE,和 Crystal Reports 9
2)这个error number 5是出现在LoadSaveReportException里的
Thanks
[ Last edited by DRAGONISM on 20-1-2005 at 03:30 PM ] |
|
|
|
|
|
|
|
发表于 21-1-2005 08:11 AM
|
显示全部楼层
想问下。。。 你的project在自己的电脑run时会有问题吗?
因为通常酱的error message 是你pass dataset 进report时出了问题。。 可能是你拿的data 和在datatset 的field 不符合。所以要肯定的是在你本身跑时没问题。 |
|
|
|
|
|
|
|

楼主 |
发表于 22-1-2005 11:34 AM
|
显示全部楼层
在我的电脑跑是完全没有问题的。
我想补充一点的是:我deploy去那架电脑B是windows 98的,今天试了deploy去另一架windows xp,却没有问题。可是偏偏我的上司要我deploy去windows 98 。
大家有遇过这个问题吗? |
|
|
|
|
|
|
|
发表于 22-1-2005 12:19 PM
|
显示全部楼层
是没有DEPLOY到最新的MSDE吗?.. 你是用ACCESS DATABASE 的吗?试下INSTALL MS ACCESS 或把ACCESS FORMAT 改成败ACCESS97..不要用 ACCESS2003
[ Last edited by AquaMax on 22-1-2005 at 12:21 PM ] |
|
|
|
|
|
|
|

楼主 |
发表于 22-1-2005 01:17 PM
|
显示全部楼层
在我自己的电脑和deploy的电脑都是install同样version的MSDE(MSDE release A)。
我是用SQL SERVER 2000 database,可是在deploy的电脑只有install Windows 98, MSDE和.Net Framework 1.1。
(我是在format后,安装Windows 98, MSDE和.Net Framework 1.1,然后deploy我的application。从database读资料,update资料完全没有问题,问题是出现在当要开report viewer时 。)
[ Last edited by DRAGONISM on 22-1-2005 at 01:19 PM ] |
|
|
|
|
|
|
|
发表于 22-1-2005 03:41 PM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 22-1-2005 11:35 PM
|
显示全部楼层
DRAGONISM 于 22-1-2005 01:17 PM 说 :
在我自己的电脑和deploy的电脑都是install同样version的MSDE(MSDE release A)。
我是用SQL SERVER 2000 database,可是在deploy的电脑只有install Windows 98, MSDE和.Net Framework 1.1。
(我是在format后, ...
我遇倒的问题和你不一样,我出现的是ERROR MESSAGE 是INVALID KEYCODE32.DLL,我用的是翻版的,所以没有REG CODE,有没有办法解决? |
|
|
|
|
|
|
|
发表于 24-1-2005 12:53 AM
|
显示全部楼层
萧峰 于 22-1-2005 11:35 PM 说 :
我遇倒的问题和你不一样,我出现的是ERROR MESSAGE 是INVALID KEYCODE32.DLL,我用的是翻版的,所以没有REG CODE,有没有办法解决?
翻版的code都是一样的for crystal report
楼主是使用crystal report 9吗?好像对方的电脑必须也装上才可以呀
或者在deployment的时候有包含merge file(s)吗? |
|
|
|
|
|
|
|

楼主 |
发表于 24-1-2005 03:34 PM
|
显示全部楼层
|
|
|
|
|
|
|

楼主 |
发表于 24-1-2005 06:41 PM
|
显示全部楼层
|
|
|
|
|
|
|

楼主 |
发表于 24-1-2005 06:49 PM
|
显示全部楼层
|
|
|
|
|
|
|

楼主 |
发表于 24-1-2005 07:19 PM
|
显示全部楼层
由于我做development的电脑(电脑A) 和 做deployment的电脑(电脑B)的SQL SERVER名字不一样,所以才会有以下的error:
当快要成功display report时,忽然report viewer 会 pop up 一个 'Database Login Box', 如图。之后我需要打进相关的资料,才可顺利看到report。

之前我也post过同样的问题,那时候的情形是-'从我朋友做的crystal report在我电脑run时出现的database login box'。之后我依照网友的建议,把crystal report里的 Database Connection 换掉就可以了,如图:

可是现在deploy后,crystal report (.rpt file) 的database connection 还是link去我电脑的sql server,应该才造成database login box一直pop up的问题。
我也依照网友的建议,参考了以下的link后,加了一些coding
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/crystlmn/html/crtskaccessingsecuredatabases.asp , 问题还是一样,还有什么我漏掉了吗?
- Imports CrystalDecisions.CrystalReports.Engine
- Imports CrystalDecisions.Shared
- Imports CrystalDecisions.Windows.Forms
- Imports CrystalDecisions.ReportSource
- Public Class frmRptViewer2
- Inherits System.Windows.Forms.Form
- #Region " Windows Form Designer generated code " ...
-
- Dim rptPrintDoc As New ReportDocument
- Private Sub CryRptViewer_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles CryRptViewer.Load
- 'Create a report document instance to hold the report
- Dim sReport As String
- Dim sString As String
- Dim sProcess As String
- Try
- 'Change screen cursor
- Me.Cursor = Cursors.WaitCursor
-
- Select Case sProcess
- Case "Debit Note"
- sReport = "CrystalReport1.rpt"
- End Select
- rptPrintDoc.Load(Application.StartupPath & "" & sReport)
- 'Set the report source for the crystal reports
- 'viewer to the report instance.
- Me.CryRptViewer.ReportSource = rptPrintDoc
- Dim logOnInfo As New TableLogOnInfo
- Dim i As Integer
- 'Loop through every table in the report.
- For i = 0 To rptPrintDoc.Database.Tables.Count - 1
- 'Set the connection information for current table.
- logOnInfo.ConnectionInfo.ServerName = gSQLServer
- logOnInfo.ConnectionInfo.DatabaseName = gSQLDb
- logOnInfo.ConnectionInfo.UserID = gUser
- logOnInfo.ConnectionInfo.Password = gPwd
- rptPrintDoc.Database.Tables.Item(i).ApplyLogOnInfo(logOnInfo)
- Next i
- 'Zoom viewer to fit to the whole page
- Me.CryRptViewer.Zoom(2)
- Me.Cursor = Cursors.Arrow
- Catch Exp As LoadSaveReportException
- MsgBox(CStr(Err.Number) & "-" & Err.Description, MsgBoxStyle.Critical, "!!!")
- Catch Exp As Exception
- MsgBox(Exp.Message, MsgBoxStyle.Critical, "General Error")
- End Try
- End Sub
- End Class
复制代码
希望高手多多指点在下。谢谢。
[ Last edited by DRAGONISM on 24-1-2005 at 07:21 PM ] |
|
|
|
|
|
|
|

楼主 |
发表于 27-1-2005 12:26 PM
|
显示全部楼层
终于找到答案了。下面的程序是对的,其实我摆了个乌龙(错在Me.CryRptViewer.ReportSource = rptPrintDoc的位置),大家不要笑我。
- Imports CrystalDecisions.CrystalReports.Engine
- Imports CrystalDecisions.Shared
- Imports CrystalDecisions.Windows.Forms
- Imports CrystalDecisions.ReportSource
- Public Class frmRptViewer2
- Inherits System.Windows.Forms.Form
- #Region " Windows Form Designer generated code " ...
-
- Dim rptPrintDoc As New ReportDocument
- Private Sub CryRptViewer_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles CryRptViewer.Load
- 'Create a report document instance to hold the report
- Dim sReport As String
- Dim sString As String
- Dim sProcess As String
- Try
- 'Change screen cursor
- Me.Cursor = Cursors.WaitCursor
-
- Select Case sProcess
- Case "Debit Note"
- sReport = "CrystalReport1.rpt"
- End Select
- rptPrintDoc.Load(Application.StartupPath & "" & sReport)
- Dim logOnInfo As New TableLogOnInfo
- Dim i As Integer
- 'Loop through every table in the report.
- For i = 0 To rptPrintDoc.Database.Tables.Count - 1
- 'Set the connection information for current table.
- logOnInfo.ConnectionInfo.ServerName = gSQLServer
- logOnInfo.ConnectionInfo.DatabaseName = gSQLDb
- logOnInfo.ConnectionInfo.UserID = gUser
- logOnInfo.ConnectionInfo.Password = gPwd
- rptPrintDoc.Database.Tables.Item(i).ApplyLogOnInfo(logOnInfo)
- Next i
- 'Set the report source for the crystal reports
- 'viewer to the report instance.
- Me.CryRptViewer.ReportSource = rptPrintDoc
- 'Zoom viewer to fit to the whole page
- Me.CryRptViewer.Zoom(2)
- Me.Cursor = Cursors.Arrow
- Catch Exp As LoadSaveReportException
- MsgBox(CStr(Err.Number) & "-" & Err.Description, MsgBoxStyle.Critical, "!!!")
- Catch Exp As Exception
- MsgBox(Exp.Message, MsgBoxStyle.Critical, "General Error")
- End Try
- End Sub
- End Class
复制代码
[ Last edited by DRAGONISM on 27-1-2005 at 12:27 PM ] |
|
|
|
|
|
|
|
发表于 15-2-2005 10:15 AM
|
显示全部楼层
erm...
请问。。。如果我是用JSP。。。 那么。。。应该如何CONFIGURE CRYSTAL REPORT 呢???
谢谢。。。 |
|
|
|
|
|
|
|

楼主 |
发表于 21-6-2005 01:43 PM
|
显示全部楼层
对不起,博士,我不知道JSP要如何configure |
|
|
|
|
|
|
|
发表于 22-6-2005 08:26 PM
|
显示全部楼层
老兄,你害我瞪大眼睛研究,结果竟然是这样?可恶。
想不到.net的deployment浆麻烦,建议作精华。 |
|
|
|
|
|
|
|
发表于 22-6-2005 08:29 PM
|
显示全部楼层
这个handle是自己defind的吗?
Private Sub CryRptViewer_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles CryRptViewer.Load
还有,
你有Try。。。。。catch,error message没有show什么问题啊?
[ Last edited by haroldlbc on 22-6-2005 at 08:34 PM ] |
|
|
|
|
|
|
|
发表于 22-6-2005 08:32 PM
|
显示全部楼层
如果我有楼主的一半冷静就好了,我还是讨厌做programmer。 |
|
|
|
|
|
|
|

楼主 |
发表于 24-6-2005 10:13 PM
|
显示全部楼层
haroldlbc 于 22-6-2005 08:29 PM 说 :
这个handle是自己defind的吗?
Private Sub CryRptViewer_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles CryRptViewer.Load
还有,
你有Try。。。。。catch,error message没有show ...
Private Sub CryRptViewer_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles CryRptViewer.Load
是VB.NET自动generate的, 只要双击CR Viewer的object就行。
Try。。。。。catch,error message没有show任何error msg, 因为根本就没有error。
report viewer 会 pop up 一个 'Database Login Box', 是因为dll的问题(在Win98
需要不同version的dll), 而不是coding问题。 |
|
|
|
|
|
|
| |
本周最热论坛帖子
|