Crystal报告的数据库登录 [英] Database Login for Crystal reports

查看:67
本文介绍了Crystal报告的数据库登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我是.net的新手,因为我主要使用VB6.0& Crystal报告,

我在VB.net/SQL Server2000中开发了一个Window应用程序并使用了

Crystal reports8.5,我在表单中使用了CRViewer。 />
现在我的问题是,当我尝试打开Crystal报告thro VB.net时,它将提供数据库登录密码的
提示,我已经提供了Crystal

报告,也是申请。(我使用DSN连接)

请帮我解决这个问题....


样本代码。

{

按钮点击...

Dim rpt1 As New Form2''这里Form2是CrystalReportViewer的形式,

Viewer中的ReportSource设置为RPT文件...

rpt1.Show()

}

提前致谢....

如果这是发布这个问题的错误论坛我是否支持。


问候,

Murali


-

Murali

VSM Software(P)Ltd。

班加罗尔

Hi All
I am new to .net, as i worked majorily on VB6.0 & Crystal reports,
I have developed an Window application in VB.net/SQL Server2000 and using
Crystal reports8.5, I have used the CRViewer in the form.
Now my problem is when i try to open Crystal report thro VB.net, it will
prompt for database login password, which i have already supplied in Crystal
report and also thro the application.(I am using DSN based connection)
Please help me to solve this problem....

Sample Code.
{
on Button click...
Dim rpt1 As New Form2 '' Here Form2 is the form with CrystalReportViewer,
ReportSource in Viewer is set to RPT file...
rpt1.Show()
}
Thanks in advance....
I apoligise if this is the wrong forum to post this question.

Regards,
Murali

--
Murali
VSM Software (P) Ltd.
Bangalore

推荐答案




你说''它会提示我输入数据库登录密码,我已经

在Crystal报告中提供''。你有没有提供这个信息。在向导中用于
数据库连接还是硬编码了?如果你有硬编码,你可以提供一个例子。


Rgds,Phil

Murali通过DotNetMonster。 COM" < FO *** @ DotNetMonster.com>在消息中写道

新闻:54 *********** @ DotNetMonster.com ...
Hi,

You state ''it will prompt for database login password, which i have already
supplied in Crystal report''. Have you supplied this info. in the wizard for
the db connection or have you hard-coded it? If you have hard-coded it can
you provide an example.

Rgds, Phil
"Murali via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in message
news:54***********@DotNetMonster.com...
大家好
我是新来的.net,因为我主要研究VB6.0& Crystal报道,我在VB.net/SQL Server2000中开发了一个Window应用程序并使用了Crystal Reports8.5,我在表单中使用了CRViewer。
现在我的问题是当我尝试打开VB报告的水晶报告,它将提示数据库登录密码,我已经提供了水晶报告,也是应用程序。(我使用的是基于DSN的连接)
请帮我解决这个问题....

示例代码。
{
按钮点击...
Dim rpt1 As新Form2''这里Form2是带有CrystalReportViewer的表单,
Viewer中的ReportSource设置为RPT文件...
rpt1.Show()
}
谢谢提前....
如果这是发布这个问题的错误论坛,我会道歉。

问候,
Murali

-
Murali
VSM Software(P)Ltd。
班加罗尔
Hi All
I am new to .net, as i worked majorily on VB6.0 & Crystal reports,
I have developed an Window application in VB.net/SQL Server2000 and using
Crystal reports8.5, I have used the CRViewer in the form.
Now my problem is when i try to open Crystal report thro VB.net, it will
prompt for database login password, which i have already supplied in
Crystal
report and also thro the application.(I am using DSN based connection)
Please help me to solve this problem....

Sample Code.
{
on Button click...
Dim rpt1 As New Form2 '' Here Form2 is the form with
CrystalReportViewer,
ReportSource in Viewer is set to RPT file...
rpt1.Show()
}
Thanks in advance....
I apoligise if this is the wrong forum to post this question.

Regards,
Murali

--
Murali
VSM Software (P) Ltd.
Bangalore



HI Phil!

I在des期间使用过DSN连接我选择了所需的

次观看&字段...通过VB.net,我打开报告(我在表单中使用了CRViewer

,然后点击主窗体上的按钮打开该表单。)


请帮忙....


问候,

Murali


Phil G 。写道:
HI Phil!
I had used DSN connection, during the design time i selected the required
views & fields...And through VB.net i open the Report ( I have used CRViewer
in a form and i open that form on click of a button from the main form.)

Please help....

Regards,
Murali

Phil G. wrote:


你说''它会提示输入数据库登录密码,我已经在Crystal报告中提供了''。你有没有提供这个信息。在向导中进行数据库连接还是硬编码了?如果你有硬编码就可以提供一个例子。

Rgds,Phil
Hi,

You state ''it will prompt for database login password, which i have already
supplied in Crystal report''. Have you supplied this info. in the wizard for
the db connection or have you hard-coded it? If you have hard-coded it can
you provide an example.

Rgds, Phil
大家好
我是新来的.net,因为我主要研究VB6.0& Crystal报道,
Hi All
I am new to .net, as i worked majorily on VB6.0 & Crystal reports,


[引用文字剪辑 - 19行]


[quoted text clipped - 19 lines]

问候,
Murali
Regards,
Murali




-

Murali

VSM Software(P)Ltd。

印度班加罗尔

留言通过DotNetMonster.com发布
http://www.dotnetmonster.com/Uwe/For...b-net/200509/1


嗨Murali,


不幸的是我犯了这个错误! :-)


虽然你可能会看到弹出式登录信息框总是

包含登录名,但它仍然需要密码。这显然是正确的操作,虽然我个人并不认为需要

专门编码信息。如果它已经通过

IDE输入。


但是,您需要做的是使用CR的TableLogonInfo类。这里是

一个例子: -


[Global Decs]


Dim objRepDoc As New ReportDocument

Dim crTable As Table

Dim crLogInfo As CrystalDecisions.Shared.TableLogOnInfo


[方法调用 - 可能在加载或cmdbutton]


crTable = objRepDoc.Database.Tables(0)

crLogInfo = crTable.LogOnInfo

使用crLogInfo.ConnectionInfo

.UserID =" username"

.Password =" password"

End with

crTable.ApplyLogOnInfo(crLogInfo)

frmRep.CRViewer.ReportSource = objRepDoc

frmRep.Show()


如果您遇到问题,请告诉我。祝好运。 Phil


" Murali via DotNetMonster.com" < u14242 @乌韦>在消息中写道

news:54ecef9ca0618 @ uwe ...
Hi Murali,

Unfortunately I made this ''mistake''! :-)

Although you will probably see that the pop-up login info box always
includes the login name, it still requires the password. This apparently is
the correct operation, although personally I don''t see the need for
specifically coding the info. if it has already been entered through the
IDE.

However, what you need to do is use the TableLogonInfo Class of CR. Here''s
an example:-

[Global Decs]

Dim objRepDoc As New ReportDocument
Dim crTable As Table
Dim crLogInfo As CrystalDecisions.Shared.TableLogOnInfo

[method call - maybe in load or cmdbutton]

crTable = objRepDoc.Database.Tables(0)
crLogInfo = crTable.LogOnInfo
With crLogInfo.ConnectionInfo
.UserID = "username"
.Password = "password"
End With
crTable.ApplyLogOnInfo(crLogInfo)
frmRep.CRViewer.ReportSource = objRepDoc
frmRep.Show()

Let me know if you have problems. Good luck. Phil

"Murali via DotNetMonster.com" <u14242@uwe> wrote in message
news:54ecef9ca0618@uwe...
HI Phil!
我曾经使用DSN连接,在设计时我选择了所需的
观点&字段...并通过VB.net我打开报告(我在表格中使用了
CRViewer
,然后点击主窗体上的按钮打开该表格。)
<请帮忙....

问候,
Murali

Phil G.写道:
HI Phil!
I had used DSN connection, during the design time i selected the required
views & fields...And through VB.net i open the Report ( I have used
CRViewer
in a form and i open that form on click of a button from the main form.)

Please help....

Regards,
Murali

Phil G. wrote:

你声明''它会提示输入数据库登录密码,我已经在Crystal报告中提供了
。你有没有提供这个信息。在向导中
用于数据库连接还是硬编码了?如果你有硬编码就可以提供一个例子。

Rgds,Phil
Hi,

You state ''it will prompt for database login password, which i have
already
supplied in Crystal report''. Have you supplied this info. in the wizard
for
the db connection or have you hard-coded it? If you have hard-coded it can
you provide an example.

Rgds, Phil
大家好
我是新来的.net,因为我主要研究VB6.0& Crystal报道,
Hi All
I am new to .net, as i worked majorily on VB6.0 & Crystal reports,


[引用文字剪辑 - 19行]


[quoted text clipped - 19 lines]

问候,
Murali
Regards,
Murali



-
Murali
VSM Software(P)Ltd。
印度班加罗尔

来自DotNetMonster.com的消息
http://www.dotnetmonster.com/Uwe/For .. .b-net / 200509/1



这篇关于Crystal报告的数据库登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆