cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal report for VS2010 asks password on non development pc

massimo_sansiveri
Discoverer
0 Kudos

Hi to all,

I developed an application with VS2010 prof. containing some reports created with Crystal version for Visual studio.

On my computer everything is ok either running it from the development environment or running the compiled program that is placed in the same position that users should use. If you launch the program from another computer (test done on three different PCs) when you view the report it shows a login screen that is visibile at this link

[http://www.dotnethell.it/forum/ShowImage.aspx?ImageID=1682]

and it doesn't show the report. Also if I insert username and password nothing to do it returns Access denied.

My code (VB) used to pass credentials to report viewer is the following:


Dim report As ReportDocument = New ReportDocument 
Dim nr As Integer, i As Integer 

Try 
report.Load(nomeReport) 
Dim logOnInfo As New TableLogOnInfo 

nr = report.Database.Tables.Count 
For i = 0 To nr - 1 
    logOnInfo = report.Database.Tables.Item(i).LogOnInfo 
    logOnInfo.ConnectionInfo.ServerName = cSettings.server_name 
    logOnInfo.ConnectionInfo.DatabaseName = cSettings.db_name 
    logOnInfo.ConnectionInfo.UserID = cSettings.dbUser 
    logOnInfo.ConnectionInfo.Password = cSettings.dbPassword 
    logOnInfo.TableName = report.Database.Tables.Item(i).Name
    report.Database.Tables(i).ApplyLogOnInfo(logOnInfo) 
Next 
crViewer.ToolPanelView = CrystalDecisions.Windows.Forms.ToolPanelViewType.None 
Me.crViewer.ReportSource = report 
Catch ex As Exception 
MsgBox("Errore nella stampa del report " & ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation) 
End Try

I use SQL Server express 2008 as database using oledb to connect to it.

On client PCs I installed runtime version 13.0.1 and operating systems are both windows xp and 7

Where is my fault?

Thanks in advance,

Massimo

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Compare the SQL Server express 2008 client - it should be the same on all.

As a test, comment out the logon code and let the report prompt for the logon - does that work?

See the article [Troubleshooting Guide to Database Connectivity Issues with Crystal Reports in Visual Studio .NET Applications|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b0225775-88c4-2c10-bd80-8298769293de]

Also, downloading the CR 2011 designer and installing it on one of these client boxes is a good idea. You can download CR 2011 eval from here;

http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx

See if you can run the report in the CR 2011 designer. If not, it may point you to a solution.

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

massimo_sansiveri
Discoverer
0 Kudos

Thank you very much for your answer.

I solved changing data provider from sql server native client 10.0 to oledb for sql server and it works.

Thanks again,

Massimo

former_member183750
Active Contributor
0 Kudos

Good to hear.

The resources I sent in the last post will still make a great reference to keep for the future. It's one way I try to minimize the developer's headaches

Have a great day \ evening(?),

- Ludek

Answers (0)