如何避免在asp.net/vb的Crystal报表中出现登录提示 [英] how to avoid login prompt in crystal reports in asp.net/vb
本文介绍了如何避免在asp.net/vb的Crystal报表中出现登录提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
发现我对使用vs 2005的asp.net/vb不熟悉.
我拥有oracle数据库,而在创建水晶报表时,它在设计时效果很好
当我通过网络浏览器致电时,要求输入登录提示
我厌倦了编写背后的代码(我从网上获得的代码),它显示了一些错误
fiends i am new to asp.net/vb i am using vs 2005
i having oracle database, while i create a crystal report it works well in design time
when i call through web browser it asks for login prompt
i tired to write the code behind ( the code i got from net) it shows some error
ReportDocument cryRpt = new ReportDocument()
TableLogOnInfos crtableLogoninfos = new TableLogOnInfos()
TableLogOnInfo crtableLogoninfo = new TableLogOnInfo()
ConnectionInfo crConnectionInfo = new ConnectionInfo()
Tables CrTables
cryRpt.Load("PUT CRYSTAL REPORT PATH HERE\CrystalReport1.rpt")
crConnectionInfo.ServerName = "YOUR SERVER NAME"
crConnectionInfo.DatabaseName = "YOUR DATABASE NAME"
crConnectionInfo.UserID = "YOUR DATABASE USERNAME"
crConnectionInfo.Password = "YOUR DATABASE PASSWORD"
CrTables = cryRpt.Database.Tables
foreach (CrystalDecisions.CrystalReports.Engine.Table CrTable in CrTables)
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
next
crystalReportViewer1.ReportSource = cryRpt
crystalReportViewer1.Refresh()
它在第1行和第3行中显示错误
我该怎么办
请帮助,在此先感谢
asok
it shows error in line 1 and 3
what have i to do
please help, thanks in advance
asok
推荐答案
对于Oracle数据库,数据库名应该为空.
For Oracle database Databasename should be empty.
crConnectionInfo.ServerName = "YOUR SERVER NAME"
crConnectionInfo.DatabaseName = ""
crConnectionInfo.UserID = "YOUR DATABASE USERNAME"
crConnectionInfo.Password = "YOUR DATABASE PASSWORD"
现在尝试.
Now try.
这篇关于如何避免在asp.net/vb的Crystal报表中出现登录提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文