On my dev pc I have set up several Crystal Reports against a dev MS SQL Express server (let's call it ServerA) using Database Type OLE DB (ADO) with a provider of SQLODEDB. I run into issues when trying to programmatically connect to a different MS SQL Express server (let's call it ServerB).
1) Dim rptToView As New CrystalDecisions.CrystalReports.Engine.ReportDocument()
2) rptToView.Load(Application.StartupPath & "\" & ReportName)
3) For i As Integer = 0 To rptToView.DataSourceConnections.Count - 1
4) rptToView.DataSourceConnections.Item(i).SetConnection(ServerName, DatabaseName, UserID, Password)
If both databases are up and running the code will load the report and then setconnection to ServerB very quickly. However, If ServerA is turned off then the .load command (line 2 in the code above) takes forever before finally progressing to the setconnection command. Clearly the report, which was created against ServerA, is trying to connect to ServerA and timing out before even giving me a chance to redirect it to ServerB. This application will be distributed to a number of different locations with different databases.
I need a way of preventing the report from automatically trying to connect to the development server before I can programmatically redirect it to the production server.
Thanks in advance
Make sure you are using SP 1 for CR 10.2:
If that does not resolve the issue, contact sales (866-681-3435) and ask for an eval of CR 2008, see if the issue is present there. Please note that there are no more Service Packs planned for CR 10.2 and an upgrade to CR 12.x or Crystal Reports for Visual Studio 2010 may have to be done.
This seems to have worked.
As a note to anyone else finding this topic later after installing SP1 I had to manually edit the form designer to make record selection formulas to work again.