Error Opening CrystalReport viewer

荒凉一梦 提交于 2019-12-11 16:45:12

问题


I have this problem which I am trying to debug for a lot of time.

The setup is like this:

i. The application is a Windows application developed using VS2005, .net 2.0.

ii. I use the Cyrstal reports component Crystal Report Viewer and dynamically display various reports in the same form.

iii. The db is SQLSERVER Express 2005 and situated on a different machine.

When I run the application on the db server, I am able to view the report. However, when I run the application on a different machine which is connected to the above dbServer, I get an error. ( I dont get this error on my dev setup)

Source: CrystakReprotViewer.CS:SendDBLogonForReport() Details:Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: [DBNETLIB][ConnectionOpen (Invalid Instance()).]Invalid connection. SQL State: 08001 Native Error: Error in File C:\DOCUME~1\admin\LOCALS~1\Temp\ActionPoints {52820D22-199C-4D46-A76B-70A55D9F54D5}.rpt: Unable to connect: incorrect log on parameters. at CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.SetTableLocation(ISCRTable CurTable, ISCRTable NewTable) at CrystalDecisions.CrystalReports.Engine.Table.set_Location(String value) at Trivalve.UI.Client.Reports.CrystalViewer.CrystalReportViewer.SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument) in D:\Ramjee\Work\Projects\Trivalve\Trivalve\src\tfssetup\2008\Trivalve_2008\Trivalve\Reports\CrystalViewer\CrystalReportViewer.cs:line 127 rptcontrollers.dll SetTableLocation

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Thanks, Ramjee


回答1:


Use datasource=servername or ip address\instance name if available,port number

Default port number is 1433 or 1434

My problem was solved with this. Posting for the use of others.




回答2:


If this is a standard installation of SQL Server Express, bear in mind that the only connection method installed by default is shared memory, and is only available on the server -- you would need to enable another connection protocol such as Named pipes or TCP/IP. To turn networking on, Use SQL Server Configuration Manager to enable relevant protocols and start SQL Browser.




回答3:


It's telling you exactly what's wrong.

Details:Logon failed.

Great, we can't logon.

(Invalid Instance()).]Invalid connection.

Okay. I bet we have "localhost" as part of the instance name in my connection string. Since I'm no longer on the "localhost", this obviously won't work. Let's try there first. Then perhaps it's the credentials that I'm using to query my database. Usually what I do is create a RO user that can only do selects on my db and use that for CR. If none of these are getting me close, let's try making sure that remote connections are enabled for SQLEXPRESS

Unable to connect: incorrect log on parameters.

Ok it's definitely a connection issue.



来源:https://stackoverflow.com/questions/506915/error-opening-crystalreport-viewer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!