Skip to Content
0

CRYSTAL REPORT ASK PASSWORD

Jul 03, 2017 at 02:49 PM

55

avatar image
Former Member

hello,

I pass the data to connect to the database through this command:

report.SetDatabaseLogon(UserId, Password, ServerName, DatabaseName);

When I open the report , It asks for the password instead the other 3 fields are filled.

In the RPT file, use the udl file to connect to the database. This is the connection string:

[oledb] ; Everything after this line is an OLE DB initstring

Provider=IBMDASQL.DataSource.1;Password=********;Persist Security Info=True;User ID=BARCODE;Data Source=*******;Initial Catalog=B00839AA

When viewing the report I used the following code:

Dim logonInfo As New CrystalDecisions.Shared.TableLogOnInfo() Dim table As Table report.Load(NomeSTP) For Each table In report.Database.Tables ' Get the TableLogOnInfo object. If table.LogOnInfo.ConnectionInfo.ServerName = "******" Then logonInfo = table.LogOnInfo ' Set the server or ODBC data source name, database name, ' user ID, and password. logonInfo.ConnectionInfo.ServerName = "172.27.1.1" logonInfo.ConnectionInfo.DatabaseName = "B00839AA" logonInfo.ConnectionInfo.UserID = "BARCODE" logonInfo.ConnectionInfo.Password = "*********" ' Apply the connection information to the table. table.ApplyLogOnInfo(logonInfo) CrystalReportViewer1.ReportSource = report

But it doesn't work.

If you first open the preview of the report and save it Without modifying anything and then you open the report

it work correctly.

How can I fix it?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Don Williams
Apr 24 at 04:52 PM
0

CR Designer no longer installs the .NET SDK package.

Go here to get it:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Don

Share
10 |10000 characters needed characters left characters exceeded
Brian Dong Jul 05, 2017 at 05:40 PM
0

Hi Stefano,

It looks like you are going through each table in the report which is good. Does your report have subreports? If it does then you will need to open each subreport and use LogonInfo the same way you did for the Main report.

Brian

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

hello,

my reports don't have subreport.

i use logoninfo for the main report.

the reports were create with crystal report XI R2 (11,5) but now i use the last version of crystal report (14) for visual studio 2012.

If i open the prewev of the report with visual studio and i save the report , Then the report don't ask the password . Initially the report weighs 18Kb after i open the prewev and save it , it weighs 64Kb.

0