Crystal Report要求登录凭据 [英] Crystal Report asks for Login Credentials
本文介绍了Crystal Report要求登录凭据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我准备了Crystal报告。
加载文件时,我传递了登录信息(服务器名称,数据库名称等)。但是,当水晶报告加载到服务器上时,它会在浏览器中显示登录信息。
请建议我?
解决方案
在你的代码中试试这个
page_load
添加这个
Dim rd As ReportDocument
rd = 新 ReportDocument
rd.Load(Server.MapPath( Reports / CrystalReport2.rpt)) rpt文件的路径
' sql stuff我正在使用数据表
Dim dt As DataTable = DataAdaptor.GetDataTable(sql)
dt.TableName = yourtable
rd.SetDatabaseLogon(dbloginname;,dbpassword;)
rd.SetDataSource(dt)
请参阅以下链接
http://forums.asp.net/t/1647609.aspx/1?Crystal+Report +证书+提示+ +部署后
http://stackoverflow.com/questions/4801835/crystal-report-credentials-prompt-after-deployment
http://crystalreporthosting.asphostcentral.com/post/Crystal-Report -Hosting-Solving-the-Login-Failed-Error-in-Crystal-Reports.aspx
http://melick-rajee.blogspot.in/2010/02/crystal-report-with-aspnet-direct.html
试试那个开放的野外探险家--->数据库字段--->右键单击 - >当前数据源--->报告连接----->报告----->属性---->设置属性为---
数据来源:.\Databasename.accdb
和代码观众形式加载为
Dim cryRpt As New ReportDocument
Dim Report1 As new rptItemWise
Dim strServerName As String
strServerName = Application.StartupPath
rptItemWise.SetDatabaseLogon(admin,,strServerName, dastabasename.accdb,真实的)
cryRpt.Load(Application.StartupPath +\\ \\ rptItemWise.rpt)
也会更改与数据源相同的报表连接我认为该代码适合您....
I have prepared Crystal report.
While loading file, I passed the login information(server name, db name etc). But, when crystal report loads on the server, it asks for login information when displayed in browser.
Please suggest me?
解决方案
try this in your code behind
on page_load
add this
Dim rd As ReportDocument rd = New ReportDocument rd.Load(Server.MapPath("Reports/CrystalReport2.rpt")) 'path to your rpt file 'sql stuff i am using a datatable Dim dt As DataTable = DataAdaptor.GetDataTable(sql) dt.TableName = "yourtable" rd.SetDatabaseLogon(dbloginname;, dbpassword;) rd.SetDataSource(dt)
Please see follwong links
http://forums.asp.net/t/1647609.aspx/1?Crystal+Report+Credentials+Prompt+after+deployment
http://stackoverflow.com/questions/4801835/crystal-report-credentials-prompt-after-deployment
http://crystalreporthosting.asphostcentral.com/post/Crystal-Report-Hosting-Solving-the-Login-Failed-Error-in-Crystal-Reports.aspx
http://melick-rajee.blogspot.in/2010/02/crystal-report-with-aspnet-direct.html
try that open field explorer---> database field --->Right Click -->current Data source --->reports connection----->report ----->property ----> set Property as---
Data Source: .\Databasename.accdb
and code on viewer form load as
Dim cryRpt As New ReportDocument
Dim Report1 As New rptItemWise
Dim strServerName As String
strServerName = Application.StartupPath
rptItemWise.SetDatabaseLogon("admin", "", strServerName, "dastabasename.accdb", True)
cryRpt.Load(Application.StartupPath + "\rptItemWise.rpt")
also change the report connection same as data source i think that code work for you ....
这篇关于Crystal Report要求登录凭据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文